Localization¶
The template uses Unity Localization String Tables. Text is referenced by category (the table name) plus
key. Included languages: English (en, default and fallback) and Brazilian Portuguese (pt-BR). On
first launch the game follows the system language; the player's choice in the settings is saved.
The tables are in Localization/Tables/: UI, Settings, Levels, Weapons, Enemy, Collectable,
Ability and Hints. Each name must match a value of the LocalizationCategory enum.
Add a text¶
- Open Window > Asset Management > Localization Tables and create the key in both languages.
- Use it with a
LocalizedTMPTextcomponent (UI), aLocalizedStringReffield (scripts), or in code:
using AiasTech.Localization;
string title = LocalizationManager.GetString(LocalizationCategory.UI, "SecretFound");
Use {0} for dynamic values (string.Format); Smart Strings are not supported. A missing key shows as
UNAVAILABLE_KEY; use TryGetString or the fallback overload when absence is expected.
Add a language¶
- Create the Locale in Localization Settings > Locale Generator (e.g.
es) and save it inLocalization/Locales/. - Set the Locale's Locale Name to the language's native name (e.g.
Español). - Add the language column to all 8 tables and translate.
- In
Scripts/Localization/Core/LocalizationManager.cs, add theSystemLanguagetoSupportedLanguagesand map it inTryGetLocale(e.g.SystemLanguage.Spanish => "es"). Without this, the language doesn't appear in the selector. - Open Tools > AiasTech > Setup and click Fix all to register the Locale and tables with Addressables.
Locale Name is what the player sees
The language selector shows each Locale's Locale Name (English, Português (Brasil)), so players can
find their language even if they can't read the current one.
The bundled font (Jersey 10) covers the Latin alphabet. For other scripts, add a TMP Font Asset as a fallback.
Add a table¶
Create a String Table Collection named after a new LocalizationCategory value added at the end of the enum
(it is saved as a number), then run Setup. Tables ship as local Addressables; see Build the game.
For internals, see Assets/DungeonCrawler/Scripts/Localization/ARCHITECTURE.md.