Skip to content

localization: Scratchpad-safe gettext foundation with Spanish catalog - #9

Merged
trssharp merged 2 commits into
mainfrom
feature/localization-foundation
Aug 20, 2026
Merged

localization: Scratchpad-safe gettext foundation with Spanish catalog#9
trssharp merged 2 commits into
mainfrom
feature/localization-foundation

Conversation

@trssharp

Copy link
Copy Markdown
Owner

Summary

Adds complete localization infrastructure so ClassicSpeech follows NVDA's interface language automatically.

Changes

  • Scratchpad-safe gettext helper (): identity fallback for Scratchpad/harness; loads add-on catalog when installed
  • All user-facing strings marked translatable: dialog labels, group headings, checkbox/choice labels, spoken messages, Input Gestures category
  • Literal templates only — no f-strings in calls, so extraction works
  • Internal config IDs preserved (profile names, token keys, stored values stay English)
  • Plural-aware PO/MO pipeline — both Spanish forms survive compilation
  • Spanish catalog with 21 safe NVDA seeds pre-filled (Cancel→Cancelar, OK→Aceptar, etc.)
  • Packaging: compiled included; / excluded

Files added

  • (352 messages)
  • (translator workflow)
  • (7 tests: extraction, plural handling, catalog loading, fallback)

Verification

  • All localization & packaging harnesses pass
  • 18/19 project harnesses pass (1 pre-existing NVDA-master braille path failure)
  • Python compilation clean
  • Add-on builds and loads Spanish catalog correctly
  • clean

Next steps

After merge, translators fork , edit in Poedit, and PR to .

- Add _speech_core/localization.py with identity fallback for Scratchpad/harness
- Mark all user-facing dialog labels, choices, spoken messages, and gesture categories translatable
- Use literal templates for extractable messages (no f-strings in _())
- Preserve internal config IDs (NVDA native, profile names, token keys) untranslated
- Fix PO/MO plural handling so both Spanish forms survive compilation
- Generate locale/classicspeech.pot (352 messages) and locale/es/LC_MESSAGES/nvda.po with 21 safe NVDA seeds
- Package includes compiled MO only; PO/POT excluded
- All localization and packaging harnesses pass
NVDA master moved braille input implementation to braille/input/inputHandler.py.
brailleInput.py is now a deprecated compat shim. Update test to check the
actual implementation path directly.
@trssharp
trssharp merged commit f0af8ae into main Aug 20, 2026
1 check passed
@trssharp
trssharp deleted the feature/localization-foundation branch August 20, 2026 13:53
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