| name | f8-features-localization-workflow |
| description | Use when implementing or troubleshooting Localization feature workflows — multi-language support, component localization, Excel-based translation tables in F8Framework. |
Localization Feature Workflow
⚠️ IMPORTANT: Before using this feature, you MUST formally initialize F8Framework in the launch sequence. Ensure ModuleCenter.Initialize(this); has run first, then create the required module, for example FF8.Local = ModuleCenter.CreateModule<Localization>(F8DataManager.Instance.GetLocalizedStrings());.
Use this skill when
- The task is about multi-language support, language switching, or localized assets.
- The user asks about Text/Image/Audio localization or Excel translation tables.
Path resolution
- Prefer project source at Assets/F8Framework.
- For usage docs, read: Assets/F8Framework/Tests/Localization/README.md
Sources of truth
- Runtime module: Assets/F8Framework/Runtime/Localization
- Editor module: Assets/F8Framework/Editor/Localization
- Test docs: Assets/F8Framework/Tests/Localization
- Translation table: Assets/StreamingAssets/config/Localization.xlsx
Key classes and interfaces
| Class | Role |
|---|
LocalizationManager | Core module. Access via FF8.Local. |
| Localization components | Text, TextMeshPro, Font, Image, RawImage, SpriteRenderer, Material, Audio, Timeline |
Supported component types
- Text / TextMeshPro — with real-time ID display in editor
- Font — font switching per language
- Image / RawImage — localized images
- SpriteRenderer — localized sprites
- Material Renderer — localized materials
- Audio Clips — localized audio
- Timeline Tracks — localized timeline
API quick reference
FF8.Local.ChangeLanguage("English");
string text = FF8.Local.GetTextFromId("test", "Support", "Format");
string text1 = FF8.Local.GetTextFromIdLanguage("test", "English");
var languages = FF8.Local.LanguageList;
string current = FF8.Local.CurrentLanguageName;
FF8.Local.Load();
FF8.Local.InjectAll();
Excel setup
- Create
Localization.xlsx in StreamingAssets/config/.
- Rename the Sheet to
LocalizedStrings.
- Column layout: ID | Language1 | Language2 | ...
- Supports 42 languages.
- Alternative: use ExcelTool
variant<name,variantName> for lightweight localization.
Workflow
- Create
Localization.xlsx with LocalizedStrings sheet.
- Add localization components to UI elements (Text, Image, etc.).
- Set ID references on components to match Excel IDs.
- Call
FF8.Local.ChangeLanguage() to switch languages.
- Use F6 shortcut for quick switching in Editor.
- For runtime content, use
GetTextFromId() for text retrieval.
- Call
InjectAll() to refresh all components after language change (if not using components).
- Use F6 in Editor for real-time language preview.
Common error handling
| Error | Cause | Solution |
|---|
| Text shows ID instead of translation | ID not found in Excel | Check ID spelling in Excel table |
| Language not available | Missing column in Excel | Add language column to Localization.xlsx |
| Font rendering wrong | Font doesn't support target language | Use font that covers target language character set |
| Android Excel read fails | StreamingAssets access on Android | Use binary cache or SyncStreamingAssetsLoader |
Cross-module dependencies
- ExcelTool: Translation tables use Excel infrastructure. Alternative: use ExcelTool variants.
- AssetManager: Localized assets (images, audio) loaded via AssetManager.
- UI: Localization components attach to UI elements.
Output checklist
- Translation Excel created with proper structure.
- Localization components attached to UI elements.
- Language switching tested.
- Validation status and remaining risks.