Operational Dashboard Translation Customisation
Default Translations
Default translations are supplied at build time.
Each module has its own scoped translation file, e.g.: i18n/htm/en.json
In addition, a global translation file exists for shared or frequently reused terms: i18n/en.json
At runtime, the global translations are merged into the scoped translations. All keys from the global file are accessible under the scoped namespace. If the same key exists in both the scoped and global files, the scoped translation takes precedence.
The default translations can be found below:
Custom Translations
Custom translations can be supplied at release time by adding a HOCON file in the following location: config/bizops/i18n/{scope}/{lang}.conf
For example: config/bizops/i18n/htm/en.conf
This file may include all or just some of the scoped translations. It is not mandatory to provide any custom translations - if the file is missing, the application will use the defaults.
Note: to override a value from the global translations in one module only, it can be provided in the scoped HOCON file.
Translation Best Practices
| Principle | Reason | Example |
|---|---|---|
Use camelCase for keys |
Consistent casing improves readability and reduces typos. |
|
Match key to value where possible |
This improves readability for developers and translators, makes it easier to find keys and reduces the chance of unintentionally duplicated values. |
Avoid:
Use:
If the value is long or descriptive, use a clear, semantic key, e.g.:
|
Avoid acronyms in keys |
This improves clarity for developers and translators and prevents unintentional duplication of values. |
Avoid:
Use:
|
Extract shared terms to the global file |
Avoids duplication; prevents bloated translation sheets; maintains consistency across modules. If a term is used across multiple modules, define it in the global translation file. If in one module a different value is needed, it can be overridden in a scoped sheet. |
Avoid:
Use:
|
Repeat values for different contexts |
Clarifies intent for developers and is essential for translators, as even if the same value is repeated in English, the context may change the grammar or tone required in another language. |
Use:
|
Avoid deeply nested keys |
Over-nesting ties keys too closely to the module or component structure, making refactoring more fragile, limiting re-usability and bloating translation files. In the IPF Operational Dashboard, deeply nested keys also prevent global translations from being used effectively. If nesting seems necessary to manage complexity, it’s usually a sign that the translations should be moved to a separate scope instead. |
Avoid:
Use:
|
Avoid sentence fragments as values |
Ensures grammatically correct sentences in all languages. |
Avoid:
Used together:
Use:
|
Use interpolation instead of concatenation |
Ensures grammatically correct sentences in all languages. |
Avoid:
Use:
|
Avoid coupling keys to models or component structures |
Prevents fragile, hard to maintain dependencies. Translation keys should be semantic and agnostic - not directly derived from the code’s internal model structure. Model fields may change or be inconsistent between modules, don’t assume they’re safe or meaningful for i18n. |
Avoid:
|
Don’t use translation keys to drive layout or structure |
Translations are meant for text content only — not layout or configuration. Relying on them for structure creates tight coupling, which can lead to brittle code and hard-to-diagnose issues when either the UI or translations change. |
Avoid: @for (column of t('versionInfo.versionColumns'); track column) {
<ng-container matColumnDef="{{ column.name }}">
<th scope="col" mat-header-cell *matHeaderCellDef>
{{ column.label }}
</th>
}
|