Namespace TDMaker.Unity.Localization
Classes
- ContentTexts
Presentation-only translations keyed by stable content IDs. Missing translations use the authored text; template IDs, baked definitions, saves and replay hashes are independent of the selected language.
- HudTexts
Keys of every text the GameHud and the campaign screens show, and their built-in English texts (used when no table has a key).
{0},{1}... are filled with numbers or names; keep them (in any order) when translating. The sample generator writes these texts into the English sample table, so a copy of that asset is a ready template.
- TextResolver
Resolves text keys for the selected language. Lookup order: the optional custom Provider, the Tables of the selected Language, the English tables, the built-in English texts (English), then the caller's fallback, then the key itself. The merged table is rebuilt only when the language, the table list or a table changes; lookups do not allocate. Version changes on every rebuild, so views can cache formatted strings and refresh them only then. The scene's instance is Texts.
- TextTable
A string table for one language: key → text. Create one with
Assets/Create/2D Tower Defense Maker/Text Table, set its LanguageCode ("en", "ko", "de", ...) and add it to textTables. Entries with an empty text count as missing (the English text is used instead), so a partly translated table still works. Several tables may share a language; later tables in the settings list override earlier ones.
- TextTable.Entry
One key and its text.
Interfaces
- ITextProvider
A source of user-visible text by key. TextTable assets implement it; implement it yourself to feed the HUD from another system (for example the Unity Localization package or a spreadsheet import) and assign it to Provider. Lookups happen when a label changes, not every frame, but should not allocate.