● Start
Add a language
every file, both sides.
English, Slovak and Czech ship at 1.0 and are the three examples to copy. A new language means translated files on both sides plus its code in a few short lists. This page names every one.
01Before you start
Pick the two-letter language code, for example de. Copy each English file named below, keep its keys and translate only the texts. The phrase rules are regular expressions written for each language, so they need someone who knows how fraud messages are worded in that language.
The server is TypeScript: once you add the code to the Locale type, npm run typecheck lists every table that still lacks the new language, so nothing is missed.
02Server
| File | What to add |
|---|---|
server/src/check/model.ts | The code in the Locale type and in LOCALES. |
server/src/content/seed/types.ts | The code in LOCALES. |
server/src/i18n/index.ts | The code in the locale list; if the language counts like Slovak and Czech (one, few, many), its plural rule. |
server/src/providers/grounded/index.ts | The code in GroundedLocale. |
server/src/i18n/<code>.json | Every finding, refusal and message text: a copy of en.json, translated. |
server/src/content/seed/<code>/ | playbooks.json and lessons.json, with the official contacts of your country in each playbook. |
server/src/lens/patterns/<code>.json | The local fraud-phrase rules. |
server/src/lens/ratings/<code>.json | The rating words fact-checkers use in that language ("false", "misleading" and so on). |
server/src/ai/prompt.ts, server/src/lens/claim/extract.ts | The language's name for the model, in LANGUAGES and LANGUAGE. |
server/src/check/summary.ts, server/src/ai/screen.ts | The words that name each level and the reassurance phrases the summary filter refuses, plus the summary templates in TEMPLATES. |
server/src/share/labels.ts | The texts of the shared verdict page, in LABELS. |
server/src/content/console-page.ts | The language as an option in the console's content editor. |
03App
| File | What to add |
|---|---|
app/lib/l10n/app_<code>.arb | A copy of app_en.arb, translated. flutter run and flutter build generate the Dart files from it. Add a language… key with the language's own name to every .arb file. |
app/lib/src/services/preferences.dart, app/lib/src/ui/l10n.dart | The code in AppLanguage, and its name in the language list of the settings screen. |
app/lib/src/services/playbooks.dart, lessons.dart, alerts.dart | The code in each locales list. |
app/lib/src/core/check/local/message_rules.dart | The code in patternLocales. |
app/assets/contract/patterns/<code>.json | A copy of the server's phrase-rule file, so the phone can check without the server. |
app/assets/playbooks/<code>.json, app/assets/lessons/<code>.json | The offline copies of the server seed. Add the code to the list in tool/sync_playbooks.sh and tool/sync_lessons.sh, then run both. |
app/lib/src/ui/playbook/playbook_screen.dart | Which country's contacts a playbook shows by default for the language. |
app/ios/Runner/<code>.lproj/InfoPlist.strings, app/ios/Runner/Info.plist | The iOS permission texts in the language, and the code in CFBundleLocalizations. |
04Check it
- Server. In
server, runnpm run typecheckuntil it reports nothing, thennpm run buildand start the server. - App. Run
tool/check.shfrom thesourcefolder, then start the app, pick the language in the settings and run one check of each kind. - Console. Open the playbooks, lessons and alerts in the console and fill in the new language.