t1k:unity:base:localization
| Field | Value |
|---|---|
| Module | base |
| Version | 2.2.2 |
| Effort | medium |
| Tools | — |
Keywords: i18n, localization, translation, unity
How to invoke
Section titled “How to invoke”/t1k:unity:base:localizationUnity Localization — Multi-Language Support
Section titled “Unity Localization — Multi-Language Support”Localization package for Unity 6 (com.unity.localization). Full pipeline for strings, assets, and locale management.
- Install
com.unity.localizationvia Package Manager - Edit → Project Settings → Localization → Create Localization Settings
- Add locales: Locale Generator → select languages → Create
- Create string tables: Assets → Create → Localization → String Table Collection
String Tables
Section titled “String Tables”Table: "UI"├── Key: "menu_start" → EN: "Start Game" | VI: "Bắt đầu" | JP: "ゲーム開始"├── Key: "menu_options" → EN: "Options" | VI: "Cài đặt" | JP: "オプション"└── Key: "menu_quit" → EN: "Quit" | VI: "Thoát" | JP: "終了"
Table: "Gameplay"├── Key: "health_label" → EN: "Health: {0}" | VI: "Máu: {0}"└── Key: "score_format" → EN: "Score: {0:N0}" | VI: "Điểm: {0:N0}"Key Gotchas
Section titled “Key Gotchas”- Async loading: Strings load asynchronously. Use
StringChangedevent, not direct access - Missing entries: Falls back to key name. Set fallback locale in settings
- Smart String escaping: Use
\{for literal braces - Locale codes: Use ISO 639-1 (en, vi, ja, ko, zh-Hans, zh-Hant)
- Preload race: Don’t call
AvailableLocales.GetLocaleuntilLocalizationSettings.InitializationOperationhas completed - Font coverage: CJK languages need large font atlases — use SDF fonts + fallback chains
- RTL: TMPro supports RTL via
isRightToLeftText. Test with Arabic/Hebrew early - Bulk conversion scope: Do not auto-localize debug/instruction/placeholder labels just because their text matches a table key; verify the text is user-facing and translated in every target locale, otherwise keep it static or report it for review
→ Full C# API, Smart Strings, locale management, asset tables, TMPro integration, import/export: references/api-and-examples.md
→ First-time enable gotchas (UITemplate Castle.Core fix, consumer asmdef references): references/enable-checklist.md
Related Skills & Agents
Section titled “Related Skills & Agents”unity-ui-toolkit— Localized UI elementsunity-audio— Localized voice/sound assetsunity-addressables— Remote locale loading
Reference Files
Section titled “Reference Files”| File | Contents |
|---|---|
| api-and-examples.md | C# API, Smart Strings, locale mgmt, asset tables, TMPro, import/export, gotchas |
| enable-checklist.md | First-time enable: TMPLocalization Castle.Core fix, consumer asmdef references for UITemplate.AutoLocalize + Unity.Localization |