Truthbeam docs
v1.0.0
Get help
● 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.

en · sk · csserverappnpm run typecheck

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

FileWhat to add
server/src/check/model.tsThe code in the Locale type and in LOCALES.
server/src/content/seed/types.tsThe code in LOCALES.
server/src/i18n/index.tsThe code in the locale list; if the language counts like Slovak and Czech (one, few, many), its plural rule.
server/src/providers/grounded/index.tsThe code in GroundedLocale.
server/src/i18n/<code>.jsonEvery 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>.jsonThe local fraud-phrase rules.
server/src/lens/ratings/<code>.jsonThe rating words fact-checkers use in that language ("false", "misleading" and so on).
server/src/ai/prompt.ts, server/src/lens/claim/extract.tsThe language's name for the model, in LANGUAGES and LANGUAGE.
server/src/check/summary.ts, server/src/ai/screen.tsThe words that name each level and the reassurance phrases the summary filter refuses, plus the summary templates in TEMPLATES.
server/src/share/labels.tsThe texts of the shared verdict page, in LABELS.
server/src/content/console-page.tsThe language as an option in the console's content editor.

03App

FileWhat to add
app/lib/l10n/app_<code>.arbA 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.dartThe code in AppLanguage, and its name in the language list of the settings screen.
app/lib/src/services/playbooks.dart, lessons.dart, alerts.dartThe code in each locales list.
app/lib/src/core/check/local/message_rules.dartThe code in patternLocales.
app/assets/contract/patterns/<code>.jsonA 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>.jsonThe 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.dartWhich country's contacts a playbook shows by default for the language.
app/ios/Runner/<code>.lproj/InfoPlist.strings, app/ios/Runner/Info.plistThe iOS permission texts in the language, and the code in CFBundleLocalizations.

04Check it

  1. Server. In server, run npm run typecheck until it reports nothing, then npm run build and start the server.
  2. App. Run tool/check.sh from the source folder, then start the app, pick the language in the settings and run one check of each kind.
  3. Console. Open the playbooks, lessons and alerts in the console and fill in the new language.