Translate Plot Device
Plot Device is built to be translated. The app and this site each take their words from plain files, and adding a language is mostly writing.
The app
Section titled “The app”- Copy
packages/i18n/src/messages/en.jsonto<code>.json(for example,fr.json). - Translate each message. Keep
$1,$2and{{PLURAL:…}}as they are: they’re filled in by the app. - Add the language to the catalogs in
packages/i18n/src/translator.ts. A test checks that every message is translated.
This site
Section titled “This site”- Add the language to
localesinapps/site/astro.config.ts, withdir: 'rtl'if it’s written right to left, and toLANGUAGESinapps/site/src/site.ts. - Translate the guide’s pages into
apps/site/src/content/docs/<code>/docs/, with the same file names as indocs/. Untranslated pages show the English with a notice, so you can go page by page. - In each translated page’s frontmatter, set
sourceHashto the English page’s hash from the report below. When the English page changes later, the report lists the translation as needing an update. - Copy
apps/site/src/i18n/en.jsonto<code>.jsonand translate the site’s own pages (the front page, Support, and the languages page).qqq.json, beside it, says what each message is and where it shows. - Add the language to
LANGUAGESinapps/site/screenshots/screens.shots.ts, so the site’s screenshots show the app in it.
Button names in the guide come from the app, through <Ui k="…" />, so they appear in the new language as soon as the app has it.
The report
Section titled “The report”pnpm site:translationslists, for every language, the pages not yet translated, the ones whose English changed since, and the site’s messages not yet translated.