The deployed translations of the language, without the namespaces generated from game data. A regional variant includes what it inherits from its parent language.
What drafts are checked against: the English translations and the language's current ones
exporttypeCatalog = {
language: string;
english: TranslationUnits.Translations;
/** Includes what a regional variant inherits from its parent language */
translations: TranslationUnits.Translations;
/** What a regional variant inherits from its parent language, left out of its files */
inherited: TranslationUnits.Translations;
};
Splits the drafts into the ones still worth merging and obsolete ones: drafts of keys that no longer exist, translated from English text that has changed since, equal to the current translation or with broken syntax.
Full translation jsons of the namespaces the pending drafts touch, the drafts written over the current translations in English key order, as pnpm run i18n:sync writes them. A regional variant's files leave out what equals its parent language's translation.
Validates that a translation keeps the special syntax of its English source: every {{variable}}, $t(nesting) and <tag> of the source and nothing else. Tags may wrap different words but must stay balanced, and a tag the source leaves empty (<0></0>) must stay empty. In plural forms {{count}} is optional since many languages spell out e.g. the singular form.
Placeholders of the text a translation has to keep, in order of first appearance. Paired tags are given as one placeholder with nothing between them (<1></1>) so it can be inserted as is.
@example
TranslationSyntax.placeholders("See <1>FAQ</1> for {{what}}"); // ["<1></1>", "{{what}}"]
exporttypeTranslationForm = {
/** Key in the language's translation json */
key: string;
/** `null` if the unit is not pluralized */
pluralCategory: Intl.LDMLPluralRule | null;
/** The English text this form is translated from */
source: string;
};
Every translatable unit of the language derived from the English translations. A pluralized English string (x_one & x_other) is expanded into the plural categories of the language, using the bare key for languages with only one category (what pnpm run i18n:sync produces).
Whether a draft written for the form is still worth merging: the English text it was translated from is unchanged and it differs from the current translation.
exporttypeTranslationUsage = {
/** Used by a component rendered on every page e.g. the navigation */
isSiteWide: boolean;
/** Route paths e.g. `/u/:identifier/builds` */
routes: string[];
/** Source files relative to the repository root */
files: string[];
};