Skip to content

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

  1. Open Window > Asset Management > Localization Tables and create the key in both languages.
  2. Use it with a LocalizedTMPText component (UI), a LocalizedStringRef field (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

  1. Create the Locale in Localization Settings > Locale Generator (e.g. es) and save it in Localization/Locales/.
  2. Set the Locale's Locale Name to the language's native name (e.g. Español).
  3. Add the language column to all 8 tables and translate.
  4. In Scripts/Localization/Core/LocalizationManager.cs, add the SystemLanguage to SupportedLanguages and map it in TryGetLocale (e.g. SystemLanguage.Spanish => "es"). Without this, the language doesn't appear in the selector.
  5. 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.