Repository navigation
Translate the interface into nine languages with a language picker - #8
Merged
Merged
Conversation
A small typed dictionary: English is the source, and each language is a JSON file that must have the same keys and placeholders (checked by tests). Plurals use Intl.PluralRules, and numbers and dates use the app language. Languages load on demand; the saved choice is read before the first render. Languages: English, Svenska, Norsk bokmål, Suomi, Dansk, Español, Français, Português (Brasil), Português (Portugal). Legal text stays in English. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Moves user-facing text out of components and utilities into the dictionary: toolbars, menus, dialogs, tooltips, error messages, the exported sidebar heading and the project library. The language picker sits in the status bar and in the touch Style sheet. Language packs are excluded from the service worker precache and cached on first use. Exported PNGs keep the system font stack, which covers the accented Latin letters these languages use. Also: text wrapping breaks words wider than a column (long Finnish compounds), the tool palette is wide enough for the longest labels, and the touch Style sheet keeps the comment text size label clear of its slider. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The palette grew to fit translated labels (for example "Opacitet"), overflowing its 56px grid column so the canvas sat under it. The palette now has a fixed width shared with the grid column, and long labels are truncated with an ellipsis; the full text is in each tool's tooltip. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the interface in nine languages: English, Svenska, Norsk bokmål, Suomi, Dansk, Español, Français, Português (Brasil) and Português (Portugal). Chinese and Japanese are not included.
src/locales/en.jsonis the source. Each other language is a JSON file with the same keys and placeholders.src/i18n/holds the core:t(),useT(), language detection, and switching.sv-SE→ Svenska,nn→ Bokmål,pt→ Brazilian Portuguese), then English. The language loads before the first render.<html lang>.Translations are my own first drafts. They are not reviewed by a native speaker or by the national orienteering federations, so please have someone check them, especially orienteering terms.
Not in this PR
/kmfor every language. Decimal separators in distances follow the app language.Testing
bun run test(65 pass). The new tests check that every language has exactly the English keys and placeholders, that no translation is empty, that browser language tags map to the right language, and that long words wrap.bun run lint,bun run buildpass.Stacked on
feat/responsive-layout, which carries the pinch-zoom fix that is still waiting to merge intomain(#7).🤖 Generated with Claude Code