super-productivity/docs/TRANSLATING.md
Maikel Hajiabadi 25896fd318
Fix frequency translations (#8000)
* fix(translation): fall back to translation language for date/time locale

* fix(translation): use correct dative ordinal inflection in German monthly nth weekday settings

* fix(translation): use correct dative ordinal inflection in German monthly nth weekday settings

* fix(date-time): reset date-time locale to active UI language when override is removed

* fix(tasks): correct monthly repeat display precedence and validity checks

* refactor(tasks): use UTC-anchored Sunday for deterministic weekday-name lookups

* fix(tasks): standardize quick settings translation keys

* test(tasks): improve getTaskRepeatInfoText test coverage for monthly nth-weekday and fallbacks

* docs(i18n): explain dative form suffix for ORD_*_NTH translation keys

* translation(de): translate all missing keys in de.json to German

* fix(date-time): prevent crashes when DateAdapter is not provided or mocked

* fix(tasks): use correct dative ordinal inflection in monthly nth weekday quick settings
2026-06-05 10:53:26 +02:00

64 lines
2.1 KiB
Markdown

# Translation Guide
Super Productivity uses JSON files for translations, located in `src/assets/i18n/`.
## How to Contribute
> **Important:** When adding or changing translation keys, **only edit `en.json` directly**. Other locale files are managed via the i18n script workflow described in [i18n-script-usage.md](i18n-script-usage.md). Editing other locale files by hand may cause your changes to be overwritten.
1. Add or update translation keys in `src/assets/i18n/en.json`
2. Run the i18n script to propagate changes to other locales (see [i18n-script-usage.md](i18n-script-usage.md))
3. Submit a pull request
## Important Notes
### Fallback Language
**English (`en.json`) is the fallback language.** If a translation is missing or empty, the app automatically displays the English text.
### Suffixes for Inflected/Dative Forms (`_NTH`)
Some keys have duplicates with an `_NTH` suffix (e.g., `ORD_FIRST` vs `ORD_FIRST_NTH`).
- `ORD_FIRST` is used as a standalone option in the quick-setting menu (e.g., "first").
- `ORD_FIRST_NTH` is used inside full sentences (e.g., dative/inflected form in German or other inflected languages like "Monthly on the first Monday").
- In languages without inflection (like English), these values are identical.
### Empty Values Are Intentional
When you see empty strings (`""`), this is **intentional** - it triggers the English fallback. Do not copy the English text into empty fields unless you're providing an actual translation.
```json
{
"SOME_KEY": ""
}
```
The above will display the English text for `SOME_KEY`.
### File Format
- Nested JSON structure
- Keys use SCREAMING_SNAKE_CASE
- Keep the structure intact - only change the string values
### Example
```json
{
"G": {
"CANCEL": "Abbrechen",
"SAVE": "Speichern"
}
}
```
## Tips
- Use `en.json` as reference for context
- Keep translations concise (UI space is limited)
- Test your translations locally if possible (`ng serve`)
## Translation Management Script
For managing missing translations and maintaining consistency, use the `tools/add-missing-i18n-variables.js` script. See [i18n-script-usage.md](i18n-script-usage.md) for detailed instructions.