Skip to content

i18n: add Brazilian Portuguese interface (stacked on #34) - #259

Draft
RicSchonfelder wants to merge 2 commits into
storytold:mainfrom
RicSchonfelder:i18n/pt-br
Draft

RicSchonfelder wants to merge 2 commits into
storytold:mainfrom
RicSchonfelder:i18n/pt-br

Conversation

@RicSchonfelder

Copy link
Copy Markdown

Stacks on #34 (the Ukrainian catalog and language selection): this branch is based on that work and adds only the Brazilian Portuguese delta. It should merge after #34 — once #34 is in main, the diff of this pull request is just this language.

What this adds

  • crates/ui-egui/src/i18n/pt-br.tsv — 1,232 rows, translated from the same English sources as uk.tsv (every key, so nothing falls back to English).
  • Language::PtBr with its app.language code (pt-BR), locale mapping (pt, pt-BR, pt_BR.UTF-8, pt-PT …) and label Português (Brasil); Preferences ▸ Interface language lists it.
  • i18n::count now carries the forms of both languages: uk = one|few|many, pt = one|other (CLDR: 0 and 1 are one).
  • The catalog and coverage tests now run against every catalog, so pt-BR gets the same guarantees as Ukrainian: unique keys, non-empty values, preserved placeholder names and order, and command/menu/gallery/literal-call coverage. A bundled-font test covers the catalog's accented letters.
  • The ignored ukrainian_interface_preview screenshot test now also renders pt-BR.

Testing

  • cargo test -p deckcraft-ui-egui — 23 passed, 0 failed (1 ignored).
  • cargo clippy -p deckcraft-ui-egui --all-targets -- -D warnings — clean.
  • cargo xtask assets — all asset files attributed (row for pt-br.tsv added).
  • cargo fmt --all -- --check — clean.
  • cargo check -p deckcraft -p deckcraft-cli — clean.

Notes

  • Terminology follows PowerPoint pt-BR where it exists (plano de fundo, faixa de opções, marcador, classificador de slides, espaço reservado, reproduzir).
  • The translation is AI-assisted (an OpenCode agent) and has not yet been proofread by a native speaker.
  • Docs updated: ATTRIBUTION.md, ROADMAP.md, docs/localization-parity.md, docs/gaps.md, docs/roadmap.md, docs/target-app-parity.md.
  • Written from DeckCraft's English strings; no proprietary localization resources were copied.

Add crates/ui-egui/src/i18n/pt-br.tsv (1,232 rows, translated from the
same English sources as uk.tsv) and the Portuguese (Brazil) choice:
Language::PtBr with its code, locale mapping (pt-*), label and `count`
forms (CLDR: 0 and 1 are one, 2 and up other).

The catalog tests now cover every catalog — unique keys, non-empty
values, preserved placeholder names and order — and the coverage tests
assert command, menu, gallery and literal-call coverage for pt-BR too.
A bundled-font test covers the catalog's accented letters.

Stacked on storytold#34: based on the Ukrainian catalog and language selection,
this commit adds only the pt-BR delta. Docs updated: ATTRIBUTION.md,
ROADMAP.md, docs/localization-parity.md, docs/gaps.md, docs/roadmap.md
and docs/target-app-parity.md.

Translated from DeckCraft's English strings with AI assistance; no
proprietary localization resources were copied.
anishguduru pushed a commit to anishguduru/deckcraft that referenced this pull request Oct 16, 2026
…torytold#259)

The page view's ScrollArea had no id of its own, so egui derived it from
the parent Ui, which is the same for every document. All tabs therefore
shared one scroll offset: switching to another document showed it at
wherever the previous one had been scrolled to (clamped to its length),
and switching back showed the first document at the other one's offset,
usually the top.

Salt the ScrollArea with the document's id so egui keeps one offset per
tab.

Test: viewer.rs::each_document_keeps_its_own_scroll_position scrolls
a.pdf to page 4, switches to b.pdf and scrolls it to page 2, then
switches back and forth: before the fix b.pdf opened on page 2 instead
of its own top. Cited as evidence on view.document-tabs.

Co-authored-by: wstock <1394687+wstock@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
anishguduru pushed a commit to anishguduru/deckcraft that referenced this pull request Oct 16, 2026
…sion scrolled (storytold#554)

Opening a PDF after a restart showed it part-way down, at the page some
other document had been left on in the previous session.

Since storytold#259 (storytold#189) the page view's ScrollArea is salted with the
document's DocId, so each tab keeps its own offset. eframe persists
egui's memory (persist_egui_memory defaults to true) to app.ron every
30 s and on quit, scroll offsets included, and restores it at the next
launch. DocIds start again at 1 every launch, so the first document
opened inherited the offset stored under id 1 last time, the second the
one under id 2, and so on.

A DocView now notes when its page view is first shown, and that frame
sets the scroll offset to zero. Navigation queued before the first frame
still wins: a zoom anchor or `goto` (--page, the PDF's open action,
reopening the last session's files at their pages, storytold#462) is applied on
top. Tabs that were already shown keep their own position, as storytold#189
needs. egui's other persisted memory (panel sizes and the like) is
untouched.

- canvas: `DocView::shown`, reset of the offset on the first frame
- tests/viewer.rs: a_new_document_opens_at_the_top_after_a_relaunch
  saves egui's memory through eframe's own RON storage path after
  scrolling a.pdf to page 4, restores it in a new app, opens c.pdf
  (DocId 1) and checks it starts on page 1 (it opened on page 4 before
  the fix) and then keeps its own position
- parity: the test is evidence on view.document-tabs

Refs storytold#189, storytold#259, storytold#462.

Co-authored-by: lloyd <lloyd@stackworx.io>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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