Summary
electron/i18n.ts knows about 12 locales; the repo ships 13. pt-BR is missing from the main-process locale map, so every Brazilian-Portuguese translation that main-process code renders falls back to English — even though the translated strings are sitting right there in the repo.
npm run i18n:check cannot catch this: it validates that the 13 locale files agree with en, which they do. The gap is in the main process's own import map.
Detail
electron/i18n.ts:29-56 defines the Locale union and the messages map. There is no commonPtBr import and no pt-BR entry.
Everything rendered by mainT() is affected — native dialogs, the tray context menu, and anything else the main process draws. A pt-BR user gets English for all of it.
Reproduction
- Set the app language to Português (Brasil).
- Trigger any main-process string — e.g. the tray context menu, or a native dialog.
- It renders in English, while
src/i18n/locales/pt-BR/common.json contains the correct translation.
Suggested fix
Four one-line additions in electron/i18n.ts:
- the
commonPtBr (and any sibling namespace) import
"pt-BR" in the Locale union
- the
messages map entry
- the
setMainLocale guard
Worth adding a check that the main-process locale list and src/i18n/locales/ cannot drift again — a test asserting Object.keys(messages) matches the locale directory listing would fail loudly the next time a locale is added to one and not the other, which is exactly how this happened.
Context
Found while reviewing #313, which adds 5 new common.json keys across all 13 locales. Its pt-BR strings are correct and complete — and unreachable. Pre-existing, so filing separately rather than expanding that PR.
Summary
electron/i18n.tsknows about 12 locales; the repo ships 13. pt-BR is missing from the main-process locale map, so every Brazilian-Portuguese translation that main-process code renders falls back to English — even though the translated strings are sitting right there in the repo.npm run i18n:checkcannot catch this: it validates that the 13 locale files agree withen, which they do. The gap is in the main process's own import map.Detail
electron/i18n.ts:29-56defines theLocaleunion and themessagesmap. There is nocommonPtBrimport and nopt-BRentry.Everything rendered by
mainT()is affected — native dialogs, the tray context menu, and anything else the main process draws. A pt-BR user gets English for all of it.Reproduction
src/i18n/locales/pt-BR/common.jsoncontains the correct translation.Suggested fix
Four one-line additions in
electron/i18n.ts:commonPtBr(and any sibling namespace) import"pt-BR"in theLocaleunionmessagesmap entrysetMainLocaleguardWorth adding a check that the main-process locale list and
src/i18n/locales/cannot drift again — a test assertingObject.keys(messages)matches the locale directory listing would fail loudly the next time a locale is added to one and not the other, which is exactly how this happened.Context
Found while reviewing #313, which adds 5 new
common.jsonkeys across all 13 locales. Its pt-BR strings are correct and complete — and unreachable. Pre-existing, so filing separately rather than expanding that PR.