Skip to content

Windows: add Portuguese (pt) localization - #295

Closed
abrahaofv wants to merge 1 commit into
vinzdg:mainfrom
abrahaofv:windows-pt-br-localization
Closed

abrahaofv wants to merge 1 commit into
vinzdg:mainfrom
abrahaofv:windows-pt-br-localization

Conversation

@abrahaofv

Copy link
Copy Markdown
Contributor

Summary

  • Adds Portuguese (pt) to the Windows port's tray menu, notch usage card, and Settings window (i18n.rs, ui/notch.html, ui/settings.html), matching the coverage already given to ru/uk/ja/ko/zh/zh-Hant.
  • resolve_auto() already falls back to pt for a pt-* Windows locale; this fills in the actual translated strings and adds pt to the language picker.
  • No behavior changes outside the new language: reviewed against the current windows/ tree (1.16.0) to avoid duplicating anything already shipped there.

Test plan

  • cargo build --release in windows/codenotch
  • cargo test — 126 passed, 3 ignored, 0 failed (includes a new portuguese_translates_every_known_key test)
  • node windows/scripts/check-ui-scripts.mjs — notch.html/settings.html inline scripts parse cleanly
  • Visual check of the Settings window and notch usage card with language set to Português

🤖 Generated with Claude Code

Covers the tray menu, notch usage card, and Settings window: the
STATIC_TEXT/TEXT/UI dictionaries in notch.html and settings.html, and the
tr() table in i18n.rs. resolve_auto() already falls back to "pt" for a
pt-* Windows locale.
@abrahaofv
abrahaofv requested a review from vinzdg as a code owner September 20, 2026 19:16
@vinzdg

vinzdg commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Thanks @abrahaofv — the HTML half of this is good work. PT_STATIC is 86 keys, an exact set match with UK_STATIC, no duplicates, every English source resolves, and all three pages still parse. If it were only settings.html and notch.html I'd take it as-is.

The Rust half is what holds it up, and it's visible on screen:

  • src/traymenu.rs has no pt arms at all — nothing in used_left, reset_text, ago or label. So the tray renders Configurações… directly above Current session: 61% Used · 39% left · Resets in 59 min. (ko is missing three arms; this is missing all of them.)
  • src/i18n.rs is missing 5 of 16 keys, including quit_app (tray.rs:68) and waiting (tray.rs:75), which are on screen every time the tray menu opens. Every other locale is 16/16. And settings.html does translate 'Quit Codenotch' → Sair do Codenotch, so the two surfaces disagree with each other in the same session.

Two more before this can go in:

  • pt or pt-BR? The Mac catalog uses pt-BR. This adds pt on the Windows side, so the same person gets different behaviour on the two platforms — and the code is written into the saved lang value in config.json, so changing it after a release strands existing users. Worth settling now. I'd take pt-BR to match the Mac unless you have a reason to prefer the broader code.
  • Reiniciando… / Reinicia em ${m} min is a mistranslation, not just drift — reiniciar reads as "restart". The Mac says Renovando… / Renova em %lld min for the same idea, which is the quota renewing. settings.html:235-237 already states that strings shared with the Mac take the Mac catalog's translation; RU_STATIC matches it on 49/49 shared keys, this matches on 25/35. The others are harmless drift (Sair do Codenotch vs Encerrar o Codenotch, Exibir vs Exibição, ao passar o mouse vs ao passar o cursor) but worth aligning while you're in there.

One you can leave to me if you'd rather: TEXT.pt in notch.html omits the 13 Claude sign-in strings that TEXT.ru carries, so that block renders English inside a Portuguese card. Inherited from the uk table you copied, so not your doing.

Heads up that main has moved today — #203 and #289 landed — but nothing you touch, so no rebase needed.

@vinzdg

vinzdg commented Sep 22, 2026

Copy link
Copy Markdown
Owner

@abrahaofv — closing this in favour of #300, which landed a few minutes ago. You had no way of knowing it existed; it was opened the day after yours, and I should have connected them sooner.

The deciding factor is the one I raised with you yesterday: pt-BR, not pt. The Mac catalog is filed under pt-BR, and the code is written into lang in config.json, so picking the other one would have left the same person on a different language across the two ports and stranded the saved value if we changed it later.

Beyond that, #300 carried the three things this one was missing, which I'd flagged: the traymenu.rs arms (yours had none, so the tray stayed English above a translated card), the five i18n.rs keys including quit_app and waiting, and the 13 Claude sign-in strings in notch.html. It also uses Renovando/Renova rather than Reiniciando/Reinicia — the mistranslation I mentioned.

It wasn't wasted: reviewing yours is what made me check the registration points properly, and #300 turned out to have a blocker of its own that I only looked for because of it — pt-BR was missing from the LANGS whitelist, so the picker offered a language it then silently discarded on save. I fixed that on merge.

There is a real follow-up open if you want it, and it came out of your PR: UK_STATIC carries a dead key ("The pill can be dragged up and down the right-hand edge…") that no longer matches any text in the page, and both uk and ko are missing the two strings #288 added — Show move handle and the arc caption. Those render English inside otherwise-complete translations today. Small, real, and yours if you'd like it.

@abrahaofv

abrahaofv commented Sep 22, 2026 via email

Copy link
Copy Markdown
Contributor Author

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.

2 participants