Skip to content

feat(i18n): extract custom_server_installer.py user-facing strings - #788

Open
thomwebb wants to merge 2 commits into
mainfrom
feat/i18n-extract-mcp-custom-server-installer
Open

feat(i18n): extract custom_server_installer.py user-facing strings#788
thomwebb wants to merge 2 commits into
mainfrom
feat/i18n-extract-mcp-custom-server-installer

Conversation

@thomwebb

Copy link
Copy Markdown
Collaborator

What

Continues the CLI i18n extraction effort (PUP-473 / PUP-480, see Jira) by migrating the 'Add Custom MCP Server' prompt flow (code_puppy/command_line/mcp/custom_server_installer.py) — the current runner-up in python -m code_puppy.i18n.audit right after add_model_menu.py (PR #706).

How

  • Wrapped all 20 non-blank emit_info/emit_warning/emit_error/emit_success literals with t(...) calls under a new mcp.custom_server.* catalog namespace.
  • Added en-US, es, and fr-CA translations for all 20 keys — parity verified programmatically (no missing/extra keys across locales).
  • Left the 5 blank emit_info("") calls and the safe_input() prompt strings untouched, matching the scope precedent set by the add_model_menu.py extraction (nothing to translate in a blank string; prompts are out of the audit tool's tracked call set).
  • Added tests/i18n/test_custom_server_installer_i18n.py, mirroring the existing per-module i18n test pattern: namespace population floor, key resolution, pseudolocalization, and interpolation checks.

Verification

  • python -m code_puppy.i18n.audit code_puppy/command_line/mcp/custom_server_installer.py: 0% → 82.8% coverage (remaining 5 sites are blank-string emit_info("") calls).
  • Repo-wide audit coverage: 26.7% → 26.9%; custom_server_installer.py no longer appears in the top-10 offenders list.
  • ruff check clean on all changed files.
  • Full existing test module (tests/command_line/mcp/test_custom_server_installer.py) + tests/i18n/ suite: 175 passed, 0 failed.
  • Manually diffed en-US/es/fr-CA key sets to confirm exact parity (20 keys each, none missing/extra).

Continues the CLI i18n extraction effort by migrating the 'Add Custom
MCP Server' prompt flow (code_puppy/command_line/mcp/custom_server_installer.py)
- the current runner-up in python -m code_puppy.i18n.audit after
add_model_menu.py.

- Wraps all 20 non-blank emit_info/emit_warning/emit_error/emit_success
  literals with t() calls under a new mcp.custom_server.* namespace.
- Adds en-US, es, and fr-CA translations for all 20 keys (parity verified).
- Leaves emit_info("") blank-line calls and safe_input() prompts alone,
  consistent with the established scope from the add_model_menu.py
  extraction (PUP-473/480).
- Adds tests/i18n/test_custom_server_installer_i18n.py mirroring the
  per-module i18n test pattern (namespace population, resolution,
  pseudolocalization, interpolation).

File coverage per the audit tool: 0% -> 82.8% (remaining 5 raw sites are
blank emit_info("") calls with no translatable text). Repo-wide coverage
26.7% -> 26.9%.
@thomwebb thomwebb self-assigned this Aug 17, 2026
…JSON

Matches the existing convention in these files (e.g. mcp.wizard.header
already stores its emoji as a literal UTF-8 character, not \uXXXX).
No content or key changes -- purely a JSON encoding fixup for the four
lines I introduced with escaped emoji (heavy plus sign, pager, globe,
satellite antenna).
@thomwebb
thomwebb force-pushed the feat/i18n-extract-mcp-custom-server-installer branch from 2b3166c to 7967efd Compare August 17, 2026 21:23
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