Additionally, the FdLanguage interface must be manually maintained:
libs/i18n/src/lib/models/fd-language.ts — the FdLanguage interface.
Translation teams edit: Language-specific .properties files (translations_de.properties, translations_es.properties, etc.)
The language-specific .properties files are read by the i18n-manage --command=sync script when generating TypeScript files. When translation teams update these files, running i18n-manage --command=sync will pick up those translations automatically.
Every other file is auto-generated:
fd-language-key-identifier.ts — generated by i18n-manage --command=sync
translations_*.properties - delivered by external translation team after translating changes to translations.properties
translations_*.ts — generated by i18n-manage operations from translations.properties and translations_*.properties
If you skip updating fd-language.ts, the build will fail with a misleading error (see Troubleshooting below). This is the single most common mistake when working with i18n keys.
Add a Key
Step 1: Update fd-language.ts (MANUAL — required)
Open libs/i18n/src/lib/models/fd-language.ts and add the property to the interface.
FdLanguage
Find the correct section (e.g., coreCalendar, coreButton). If the section doesn't exist, create it.
coreCalendar: {
// ... existing keys .../** ARIA label for the calendar legend */calendarLegendLabel: FdLanguageKey;
}
For keys with parameters:
/** Message showing count of selected items */itemsSelected: FdLanguageKey<{ count: number }>;
Step 2: Run the CLI (handles everything else)
nx run i18n:i18n-manage --command=add --key=coreCalendar.calendarLegendLabel --value="Calendar Legend" --commentType=XACT --comment="ARIA label for the calendar legend"
This single command:
Adds the new key calendarLegendLabel to translations.properties with the comment described in the arguments
Adds this default English value for each locale's ts file (e.g., translations.ts, translations_es.ts, translations_de.ts)
Comment types (auto-detected from key name if --commentType is omitted):
Type
Usage
Auto-detected from
XACT
ARIA labels, screen reader text
key contains aria
XBUT
Button labels
key contains button
XFLD
Form input labels
key contains label
XTIT
Titles and headings
key contains title
XMSG
Messages, descriptions
default fallback
XTOL
Tooltips
—
XCKL
Checkbox text
—
XRBL
Radio button text
—
XSEL
Dropdown/select values
—
XLNK
Link text
—
YINS
User instructions
—
NOTR
No translation needed
—
Step 3: Verify
nx run i18n:i18n-manage --command=validate
nx run i18n:build --skip-nx-cache
Rename a Key
Step 1: Update fd-language.ts (MANUAL)
Rename the property in the FdLanguage interface.
Step 2: Run the CLI
nx run i18n:i18n-manage --command=rename --key=coreButton.oldName --newKey=coreButton.newName
Step 3: Update component references
Search for usages of the old key string in component files:
On a call like resolveTranslationSignalFn()('coreCalendar.calendarLegendLabel').
Cause: The key exists in fd-language-key-identifier.ts (auto-generated) but NOT in fd-language.ts (manual). You forgot Step 1.
Why: The type resolver walks ObjectPathType<FdLanguage, Key>. When the property is missing from the interface, it resolves to never, making FdLanguageKeyCtx<Key> non-undefined, which forces the type system to demand a second argument.
Fix: Add the missing property to fd-language.ts.
Key "x" already exists
The key is already in translations.properties. Use rename or update instead of add.
nx run i18n:i18n-manage --command=search --searchTerm=keyName
nx run i18n:i18n-manage --command=update --key=coreButton.save --value="New Value"
Generated files not updating
nx run i18n:i18n-manage --command=sync --skip-nx-cache