Skip to content

feat(i18n): extract add_model_menu.py user-facing strings - #706

Open
thomwebb wants to merge 2 commits into
mpfaffenberger:mainfrom
thomwebb:feat/i18n-extract-add-model-menu
Open

feat(i18n): extract add_model_menu.py user-facing strings#706
thomwebb wants to merge 2 commits into
mpfaffenberger:mainfrom
thomwebb:feat/i18n-extract-add-model-menu

Conversation

@thomwebb

@thomwebb thomwebb commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

What

Continues the CLI i18n extraction effort (PUP-473 / PUP-480) by migrating the interactive model-browser TUI (code_puppy/command_line/add_model_menu.py) - the current top offender in python -m code_puppy.i18n.audit --top - onto the t() catalog.

Scope

New model_menu.* namespace covering:

  • model_menu.registry.* - registry init failures
  • model_menu.extra_models.* - extra_models.json persistence (parse/format/duplicate/add errors)
  • model_menu.credentials.* - credential prompt + edit flows
  • model_menu.custom_model.* - custom model ID / context-window entry
  • model_menu.browser.* - browser exit, unsupported-provider, no-tool-call warning, add-cancelled

37 raw sites -> 4. The remaining 4 are emit_info("") clean-newline calls with no translatable text - the same false-positive shape already accepted in prior extraction PRs (e.g. #652, #654).

Translations

Included Spanish (es) and Canadian French (fr-CA) translations for all 31 new keys in a separate commit, following the two-commit convention used by the recent extraction PRs.

Tests

Added tests/i18n/test_add_model_menu_i18n.py (9 tests) using the catalog-correctness pattern from test_config_wizard_i18n.py, since this module also owns a full-screen prompt_toolkit Application and can't be driven headlessly. Existing tests/command_line/test_add_model_menu*.py suites (310 tests) pass unmodified - no user-facing English text changed.

ruff check / ruff format --check clean. Full local suite green except two pre-existing, environment-only test_http_utils.py proxy-resolution failures caused by HTTP_PROXY/HTTPS_PROXY already being set in my shell - unrelated to this change (see PR #654 discussion).

TJ Webb added 2 commits August 5, 2026 14:41
Migrate 33 user-facing emit_* strings in the interactive model-browser
TUI (registry init, extra_models.json persistence, credential
prompting, custom-model entry, and browser exit/warning flows) to the
t() catalog under a new model_menu.* namespace.

- registry: no-providers / unavailable / load-error (model_menu.registry.*)
- extra_models.json: invalid format, parse error, already-exists,
  added, add-error (model_menu.extra_models.*)
- credential prompt + edit flows: all-set, required header, skipped,
  saved, cancelled, edit header/status/hint/saved/cancelled
  (model_menu.credentials.*)
- custom model entry: header, id hint/examples, no-name, context
  hint/examples, invalid-context, cancelled (model_menu.custom_model.*)
- browser: no-data, exited, unsupported-provider, no-tool-call
  warning, add-cancelled (model_menu.browser.*)

37 raw sites -> 4 (all 4 remaining are emit_info("") clean-newline
calls with no translatable text, same false-positive shape already
accepted in prior extraction PRs).

Tests: tests/i18n/test_add_model_menu_i18n.py (9 tests), following the
catalog-correctness pattern used for other prompt_toolkit-owned TUIs
(config_wizard) since this module also owns a full-screen Application
and can't be driven headlessly.

ruff clean; existing tests/command_line/test_add_model_menu*.py suites
(319 tests total across this run) still pass unmodified.
Spanish and Canadian French translations for the model_menu.* keys
added by the add_model_menu.py extraction. Placeholders preserved
exactly; emoji glyphs kept via \uXXXX escapes (and \U0001F511 for the
astral-plane key emoji, which needs the full 8-hex-digit Python escape
rather than a raw JS-style surrogate pair).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant