feat(i18n): extract add_model_menu.py user-facing strings - #706
Open
thomwebb wants to merge 2 commits into
Open
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 inpython -m code_puppy.i18n.audit --top- onto thet()catalog.Scope
New
model_menu.*namespace covering:model_menu.registry.*- registry init failuresmodel_menu.extra_models.*- extra_models.json persistence (parse/format/duplicate/add errors)model_menu.credentials.*- credential prompt + edit flowsmodel_menu.custom_model.*- custom model ID / context-window entrymodel_menu.browser.*- browser exit, unsupported-provider, no-tool-call warning, add-cancelled37 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 fromtest_config_wizard_i18n.py, since this module also owns a full-screenprompt_toolkitApplicationand can't be driven headlessly. Existingtests/command_line/test_add_model_menu*.pysuites (310 tests) pass unmodified - no user-facing English text changed.ruff check/ruff format --checkclean. Full local suite green except two pre-existing, environment-onlytest_http_utils.pyproxy-resolution failures caused byHTTP_PROXY/HTTPS_PROXYalready being set in my shell - unrelated to this change (see PR #654 discussion).