Internationalization
Reference: Editora’s i18n/Messages.java (tr, and available() behind the Settings language picker), the
catalogs in src/main/resources/com/editora/i18n/, and i18n/MessagesTest.java, which holds them in step.
Rules on this page 11
| ID | Level | Rule |
|---|---|---|
| Languages | ||
| INTL-01 | MUST | The app ships a message catalog for each of the six languages above, English as the base.
|
| INTL-02 | SHOULD | A new language is a messages_<code>.properties with every key, listed in the Settings
language picker and in the parity test.
|
| INTL-03 | SHOULD | Every value is translated for real: no English value is shipped in another language’s
catalog.
|
| INTL-04 | SHOULD | The layout holds in every language at 1024 px wide: rows wrap, never cut. German is today’s
longest.
|
| INTL-05 | SHOULD | A Chinese, Japanese or Korean catalog comes with a font fallback for its script.
|
| INTL-06 | SHOULD | An Arabic or Hebrew catalog sets NodeOrientation.RIGHT_TO_LEFT on every scene.
|
| Rules | ||
| INTL-07 | SHOULD | No raw English literal is passed to a control: every string comes from tr("some.key") in
one Messages class.
|
| INTL-08 | MUST | Every catalog has every key of the base catalog, and no more, each with a non-empty value.
|
| INTL-09 | SHOULD | In a value with a placeholder, a literal apostrophe is doubled; in a value without one, it
is written once.
|
| INTL-10 | SHOULD | Identifiers such as line numbers and ports use {0,number,#}, so they are not
digit-grouped.
|
| INTL-11 | SHOULD | Technical identifiers and the --help and --version text stay untranslated, outside the
catalogs.
|
Languages
Section titled “Languages”Every app ships at least these six. They are a floor, not the set: an app SHOULD add languages as people ask for them, and a new app can start with more.
| Language | Catalog |
|---|---|
| English (base) | messages.properties |
| Spanish | messages_es.properties |
| Portuguese | messages_pt.properties |
| French | messages_fr.properties |
| Italian | messages_it.properties |
| German | messages_de.properties |
- INTL-01 MUST The app ships a message catalog for each of the six languages above, English as the base.
- Check (code): the six
messages*.propertiesfiles are in the app’si18nresources. - Reference: Editora
src/main/resources/com/editora/i18n/.
- Check (code): the six
Adding a language:
- INTL-02 SHOULD A new language is a
messages_<code>.propertieswith every key, listed in the Settings language picker and in the parity test.- Check (code): the language’s code is in
Messages’ language list (which the picker shows) and in the catalog list the parity test walks. - Reference: Editora
i18n/Messages.java(LANGUAGES,available());MessagesTest’sLOCALESandALL_CATALOGS, after whichtranslationCatalogsHaveExactlyTheBaseKeySetholds it to the same keys as the others.
- Check (code): the language’s code is in
- INTL-03 SHOULD Every value is translated for real: no English value is shipped in another language’s
catalog.
- Check (code): compare each catalog’s values with the base; a value identical to the English one is a name, a term or a bare pattern that stays the same in that language (“Git: Pull (Rebase)”, “{0} · {1}”), never an untranslated sentence. No test catches it, so it is also checked in review.
- Reference: Editora
messages_*.properties.
- INTL-04 SHOULD The layout holds in every language at 1024 px wide: rows wrap, never cut. German is today’s
longest.
- Check (by hand): run the app in each language at 1024 px wide (see Quality).
- Reference: Editora
messages_de.properties.
- INTL-05 SHOULD A Chinese, Japanese or Korean catalog comes with a font fallback for its script.
- Why: Inter has no CJK glyphs.
- Check (by hand): run the app in that language and look for missing-glyph boxes.
- Reference: no app yet.
- INTL-06 SHOULD An Arabic or Hebrew catalog sets
NodeOrientation.RIGHT_TO_LEFTon every scene.- Check (code): the scene setup sets the node orientation from the current language.
- Reference: no app yet.
- INTL-07 SHOULD No raw English literal is passed to a control: every string comes from
tr("some.key")in oneMessagesclass.- Check (test): a test scans the sources for
tr("…")calls and fails when a key is missing from the base catalog. - Reference: Editora
i18n/Messages.java,MessagesTest.everyLiteralKeyUsedInTheSourcesExists.
- Check (test): a test scans the sources for
- INTL-08 MUST Every catalog has every key of the base catalog, and no more, each with a non-empty value.
- Check (test): a parity test fails the build when a key is missing, extra or empty in any catalog.
- Reference: Editora
MessagesTest.translationCatalogsHaveExactlyTheBaseKeySet,translationsAreNonEmptyAndDistinctFromKeys.
- INTL-09 SHOULD In a value with a placeholder, a literal apostrophe is doubled; in a value without one, it
is written once.
- Why: a value with a placeholder is a
MessageFormatpattern, where a lone apostrophe starts a quoted section and can swallow the placeholder after it; a value without one is shown exactly as written. - Check (test): catalog tests fail a lone apostrophe beside a placeholder and a doubled one without.
- Reference: Editora
MessagesTest.aValueWithAPlaceholderNeverHasALoneApostrophe,aValueWithoutAPlaceholderNeverDoublesAnApostrophe.
- Why: a value with a placeholder is a
- INTL-10 SHOULD Identifiers such as line numbers and ports use
{0,number,#}, so they are not digit-grouped.- Check (test): a test formats each identifier argument in every locale and fails on a grouped number.
- Reference: Editora
MessagesTest.identifierArgumentsAreNeverDigitGrouped.
- INTL-11 SHOULD Technical identifiers and the
--helpand--versiontext stay untranslated, outside the catalogs.- Check (code): the usage text is a literal in the launcher, not a
trcall. - Reference: Editora
App.java(the usage text).
- Check (code): the usage text is a literal in the launcher, not a


Pauta 4.2.0 · · Changelog · This page in the latest edition