Skip to content

Add Brazilian Portuguese translation - #35

Merged
dannycoulombe merged 2 commits into
BenchUp3D:mainfrom
cassiomartins-sant:add-brazilian-portuguese
Nov 12, 2026
Merged

dannycoulombe merged 2 commits into
BenchUp3D:mainfrom
cassiomartins-sant:add-brazilian-portuguese

Conversation

@cassiomartins-sant

@cassiomartins-sant cassiomartins-sant commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a Brazilian Portuguese (pt_BR) translation of every application message, and lets tr! choose among several catalogs instead of a Chinese on/off switch.

  • assets/i18n/pt_BR.json: all 2,019 keys from en.json, same named and positional arguments, one/other plural forms.
  • benchup-core: i18n::Language enum (English, SimplifiedChinese, BrazilianPortuguese) replaces the CHINESE flag; current_language() is new and is_chinese() is kept. build.rs generates one match per message. Chinese behaves as before (always other); Brazilian Portuguese uses one for exactly 1, like English.
  • benchup-app: "Brazilian Portuguese" appears in the language picker (appended, so saved preferences keep working). On first launch, Portuguese locales (pt, pt-BR, pt_BR.UTF-8, and also pt-PT/pt-AO, since this is the only Portuguese catalog) select it.
  • New key settings.language_brazilian_portuguese in en.json ("Brazilian Portuguese") and zh_CN.json ("Português (Brasil)").
  • Tests: Portuguese cases in the i18n, settings, language and sidebar preference tests; scripts/test_web_i18n.cjs checks every translated catalog. README notes that new keys need an entry in each translation.

The translation was drafted with AI assistance from a shared glossary that follows the Portuguese SketchUp terms Brazilian woodworkers already know (Empurrar/Puxar, Fita métrica, Equidistância, Caixa e espiga, Rabo de andorinha, Tupia…). A script then checked keys, placeholders, their order, plural forms and leading/trailing spaces. I'm a native speaker and reviewed the terminology.

Verification

Run on Ubuntu with Rust 1.97.1 in my fork's Actions:

  • cargo test --locked -p benchup-core: 308 passed (2 geometry tests skipped, see below).
  • cargo test --locked -p benchup-app --lib --profile ci-test -- language chinese: 11 passed.
  • cargo check --locked -p benchup-app --target wasm32-unknown-unknown: OK.
  • node --test scripts/test_web_i18n.cjs: the Brazilian Portuguese catalog test passes.

Already failing on main (not caused by this PR)

  • cleanup::tests::cleans_mixed_edges_and_multiple_nested_groups_without_touching_other_runs and measurement_tests::angular_dimensions_roundtrip_copy_transform_and_undo_without_extra_geometry fail on 54ddb06 without these changes.
  • The Chinese catalog test in scripts/test_web_i18n.cjs fails on main because zh_CN.json is missing 104 keys from en.json.

Add assets/i18n/pt_BR.json with every English message, and turn the Chinese on/off switch into a Language enum so tr! can choose among several catalogs. Chinese keeps using its other plural form; Brazilian Portuguese uses one for exactly 1, like English. Portuguese system and browser locales (pt, pt-BR, pt-PT) select it on first launch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dannycoulombe
dannycoulombe marked this pull request as ready for review November 12, 2026 19:29
@dannycoulombe
dannycoulombe merged commit 1352a9e into BenchUp3D:main Nov 12, 2026
2 checks passed
@dannycoulombe

Copy link
Copy Markdown
Collaborator

muito obrigado!

@cassiomartins-sant

Copy link
Copy Markdown
Contributor Author

I have read and agree to the BenchUp Contributor License Agreement, version 1.0, and I have the authority to grant the licenses described in it.

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