Multi-Language Localization Setup
Texturge provides runtime language switching through ULocalizationSubsystem (a UGameInstanceSubsystem), and the FSemanticAnchor LCS matching mechanism ensures per-character animation correspondence survives translation.
NOTE
Texturge does not use UE5’s native
UStringTablefor text localization. The proprietaryULocalizationSubsystemand semantic anchoring mechanism are independent of the engine’s localization framework — they only reuse the engine’s culture switch event (FInternationalization::OnCultureChanged).
Supported Languages
The Texturge.uplugin localization targets support 15 languages (NativeCulture = en):
| Language | Code | Language | Code | |
|---|---|---|---|---|
| English | en | Polish | pl | |
| Simplified Chinese | zh-Hans | German | de | |
| Japanese | ja | Russian | ru | |
| Korean | ko | French | fr | |
| Spanish | es | Brazilian Portuguese | pt-BR | |
| Portuguese | pt | Turkish | tr | |
| Arabic | ar | Latin American Spanish | es-419 | |
| Italian | it |
Runtime Language Switching
// Get the subsystem
ULocalizationSubsystem* Localization = GetGameInstance()->GetSubsystem<ULocalizationSubsystem>();
// Switch language (Culture Code)
Localization->SetLanguage(TEXT("ja")); // Japanese
Localization->SetLanguage(TEXT("zh-Hans")); // Simplified Chinese
Localization->SetLanguage(TEXT("ar")); // Arabic
SetLanguage sets the current culture and broadcasts OnLanguageChanged(FString NewCulture) (multicast delegate). UAnimatedTextBlock / UAnimatedRichTextBlock listen to this event and automatically trigger re-bake and replay after a language switch.
Semantic Anchoring
FSemanticAnchor (AnchorId / ContextualSnippet / SourceOffset) uses the LCS (longest common substring) algorithm to locate anchors across translated texts.
The Problem Scenario
Translated text differs in length and character sequence:
- English
"Hello"(5 chars) → Simplified Chinese"你好"(2 chars) - Each character owns independent scheduling and curve data in the animation
Anchoring Principle
static TMap<FName, int32> ULocalizationSubsystem::RelocateAnchors(
const TArray<FSemanticAnchor>& InAnchors,
const FString& InSourceText,
const FString& InTargetText);
- Exact matching (case-insensitive) takes priority
- Unmatched anchors use
FindLongestCommonSubstringfor approximate matching CalculateConfidencecomputes match confidence (0.0–1.0); low-confidence matches are deduplicated- Offsets are clamped within the target text range
Guaranteed Behavior
- Existing character animation curves carry over to the new language
- Deleted / added characters never misalign or crash animation data
- Animation start / end timings stay consistent across languages
Localization Asset Configuration
The plugin’s .uplugin declares 7 localization targets, all covering 15 languages:
| Target | Loading policy | Content |
|---|---|---|
TexturgeRuntime | Always | runtime text (node display names, prompts) |
TexturgeEditor | Editor | editor UI text |
TexturgeEditorTutorials | Never | editor tutorials |
TexturgePropertyNames | PropertyNames | property name translations |
TexturgeToolTips | ToolTips | tooltip translations |
TexturgeKeywords | Editor | keywords |
TexturgeCategory | Editor | category names |
The preconfigured localization targets require no manual creation — they register automatically when the plugin loads.
Unicode Support
Internally Texturge uses the Texturge::Unicode namespace utilities for code-point-level classification (IsCJK / IsCJKPunctuation / IsHiragana / IsKatakana / IsHangulSyllables etc.), together with FCharBreakIterator precomputed break points (CJK attachment, surrogate-pair Emoji, Hangul syllables), ensuring correct per-glyph animation for CJK and RTL text.