Skip to content

EN Localization

Cavanshirpro edited this page Sep 20, 2026 · 3 revisions

Localization — LeoMiniGames v0.7.0

Application language model

LanguageManager::availableLanguages() exposes 23 v0.7.0 application languages: en, az, tr, ru, de, fr, es, pt, it, nl, pl, uk, ar, fa, ja, ko, zh_cn, zh_tw, hi, id, vi, sv, el.

English is special: the application returns the source string directly for en. The QRC bundles 22 non-English JSON translation resources; an en.json source file exists in the repository but is not required by resources.qrc for the English UI path. This distinction matters when auditing resource inclusion.

Application translation coverage is not guaranteed to be 100% for every locale. Missing translations intentionally fall back to the source string. Do not describe “language available in the selector” as “every string is translated.”

Host/package i18n

GameI18n.text(key, fallback) resolves requested locale → language base → package default locale → English → explicit fallback/key. Packages declare locales and default_locale in metadata when needed. Runtime language changes should propagate when the game uses host localization correctly.

Validation requirements

  • valid UTF-8 JSON;
  • key and placeholder parity, especially %1-style placeholders;
  • no empty/accidentally boolean translation values;
  • runtime switch without restart/stale fallback;
  • long-text wrapping and narrow mobile layouts;
  • CJK font coverage;
  • RTL direction/layout review for Arabic/Persian and future Hebrew/Urdu;
  • critical UI must have a usable fallback.

Adding or changing an application language

A locale is not complete merely because a JSON file exists. The runtime language list in LanguageManager, the QRC resource list, translation data, user-facing language label, fallback behavior and UI layout all need to agree. When a new locale becomes runtime-supported, update LanguageManager::availableLanguages() and isSupported(), add the JSON resource to resources/resources.qrc, validate placeholders and empty values, and exercise a live language switch. Do not add a language selector entry that points to a missing resource. Conversely, a repository translation file that is not reachable from the runtime resource path is not proof of active UI support.

Locale normalization converts - to _, lower-cases the value, maps Chinese variants to zh_cn or zh_tw, and otherwise reduces longer locale strings to the two-letter language prefix. That behavior should be considered when naming new runtime locales; region-specific support outside the explicit Chinese handling requires source changes rather than documentation-only aliases.

Package localization

Game/mod packages own their own i18n/<locale>.json content and declare locales/default_locale where appropriate. A package should not assume that the host locale file contains game strings. Keep placeholders stable across package translations and treat missing package translations as a fallback case, not as a crash condition. A game that caches translated strings once at startup can become stale after a runtime language change; bindings or refresh hooks must be designed accordingly.

Layout and script QA

Translation QA includes presentation, not only text equality. Test narrow Android widths, high-DPI desktop, long German/Russian strings, CJK line breaking and font coverage, and bidirectional/RTL punctuation and alignment. Arabic and Persian are already runtime languages, so RTL issues are current v0.7.0 concerns rather than only future work. Planned Hebrew and Urdu documentation must not be described as runtime language support until the application source actually exposes them.

Failure modes to detect

Typical defects include a locale present in one list but absent from QRC, placeholder loss (%1, %2), a JSON boolean where a string was expected, untranslated values copied from another locale, hardcoded QML text bypassing Lang/GameI18n, and a fallback that never refreshes after languageChanged. Wiki translation completeness is a separate concern from application translation completeness; both must be reported independently.

Wiki localization policy

The wiki currently maintains a complete draft 20-page core matrix for 41 documentation languages. Twenty-three correspond to v0.7.0 runtime languages; eighteen are documentation-ready candidates whose application support is explicitly marked planned. Exact API names, paths, manifest keys and trust identifiers remain canonical and are not translated into different symbols. Non-English prose is a complete draft and remains open to native-speaker editorial review.

Canonical sources

Clone this wiki locally