You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
autohero/docs/i18n-display-rules.md

43 lines
2.7 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Display names and locale rules (AutoHero)
## Town names on Russian UI
For locale `ru`, **town names are not translated by meaning**. They use **pragmatic Cyrillic transliteration** of the English fantasy names (the same names shown in `en`). This keeps a single world identity across languages and avoids awkward calques (for example, not «Зола-крепость» for Cinderkeep).
Guidelines:
1. **Read like the English name**: consonants and vowels map so a Russian player can recognize the original (Willowdale → Виллоудейл, Cinderkeep → Синдеркип).
2. **Keep word boundaries** where the English has them (Thorn + watch → Торнвотч; Red + cliff → Редклифф).
3. **Do not translate semantic meaning** of the compound (no «красная скала», «звездопад», etc.) for these labels.
4. **Stable keys**: DB/API use `towns.name_key` (e.g. `town.cinderkeep.v1`); only the `ru` string in `contentLabels` / UI bundle changes.
Current Russian labels (transliteration target):
| `name_key` | English | Russian (UI) |
|------------|---------|----------------|
| `town.willowdale.v1` | Willowdale | Виллоудейл |
| `town.thornwatch.v1` | Thornwatch | Торнвотч |
| `town.ashengard.v1` | Ashengard | Ашенгард |
| `town.redcliff.v1` | Redcliff | Редклифф |
| `town.boghollow.v1` | Boghollow | Богхоллоу |
| `town.cinderkeep.v1` | Cinderkeep | Синдеркип |
| `town.starfall.v1` | Starfall | Старфолл |
| `town.mossharbor.v1` | Mossharbor | Моссхарбор |
| `town.emberwell.v1` | Emberwell | Эмбервелл |
| `town.frostmark.v1` | Frostmark | Фростмарк |
| `town.duskwatch.v1` | Duskwatch | Дасквотч |
Quest descriptions in Russian should use **these same spellings** when they mention a town.
## Quest copy
- Server stores English `title` / `description` on `quests` (authoring and fallback).
- Client resolves text by `quests.quest_key` using `frontend/src/i18n/quests.en.yml` and `quests.ru.yml` (loaded in `loadLocales.ts` together with `en.yml` / `ru.yml`). Keys must match `quest_key` in the database; EN and RU files must have the same set of keys (validated at startup).
- If a key is missing in YAML, the client falls back to the server string (usually English).
- For `visit_town` rows, the API includes `quest.targetTownId`. The quest log uses `townDisplayById()` so the destination city name follows the town transliteration rules above, not the raw English `targetTownName` from SQL.
## Related files
- Town labels and `towns.id` map: `frontend/src/i18n/contentLabels.ts`
- Quest strings: `frontend/src/i18n/quests.en.yml`, `frontend/src/i18n/quests.ru.yml`, `localizedQuestText` in `frontend/src/i18n/loadLocales.ts`