Translations
Every word a person reads lives here, one JSON file per language and namespace (ADR 0014, ADR 0015). English in messages/en/ is the source.
messages/<locale>/<namespace>.json: the messages, nested JSON whose path is the message id, in ICU MessageFormat.project.inlang/settings.json: the inlang project that Fink reads, through the next-intl plugin.glossary/<locale>.md: rules and vocabulary per language (English, français); the English one also holds the translator notes.typography.mjs: fixes apostrophes, ellipses and each language’s non-breaking spaces; it runs onmainafter every merge.
Add or change a string
- Add the message to
messages/en/<namespace>.jsonandmessages/fr/<namespace>.json, under the group of its screen or area:appfor Android and iOS screens,domainfor the words the shared Kotlin gives both apps,catalogfor exercise text. Ids are<group>.<camelCaseName>; arguments are{name}for text,{count, number}for a whole number and{count, plural, one {# step} other {# steps}}for plurals. - Read it where it's used. The build generates everything else, nothing generated is committed, and it fails when a shipped language lacks the message or names other arguments:
- Android:
R.string.<id with dots as underscores>(home.seeWorkoutisR.string.home_seeWorkout), orR.plurals.…for a plural, with arguments in order of first appearance in English. - iOS: the id followed by one format per argument, in the same order:
Text("plan.title \(name)")readsplan.title %@,L("player.step %lld %lld", index, count)readsplayer.step %lld %lld. - iOS permission text:
permission.bluetoothis written toInfoPlist.stringsasNSBluetoothAlwaysUsageDescription; a new Info.plist text is added toApple.INFO_PLIST_KEYSintools/i18n. - Shared Kotlin:
DomainText.<id in camelCase>(language, …), for exampleDomainText.countRounds(languageCode, 3).LabelsandPoulpyCoachwrap these for the view models. - Catalog:
<slug>.name,<slug>.instructions.<n>,<slug>.variationNoteand the optional, comma-separated<slug>.aliases. Changing them raises the catalogversion; CI fails a pull request that changes them without.
- Android:
- A message translators could misread gets a note in the English rules and notes, never in the JSON.
On the phones a plural can only branch on its language's forms (one, many, other…); an exact branch like =0 works in domain only.
Proofread or translate in Fink
- Open Fink and sign in with a free GitHub account.
- Open the repository
tkint/coach-poulpy; Fink findsi18n/project.inlang. - Pick the language, edit, and send the changes: Fink opens a pull request.
Read the English rules and notes and the glossary of your language (français) first. Type plain apostrophes and spaces: the repository fixes the typography after each merge.
Add a language
Add its folder under messages/ with the three files, its locale to locales in project.inlang/settings.json, and glossary/<locale>.md.