Class CsvLocalizationProvider
Built-in localization provider that loads translations from CSV files. CSV files follow the format: key,text (RFC 4180 quoting supported). Place translation files in a Resources folder using the naming convention {AssetName}.{locale} (e.g. MyDialogue.fr, MyDialogue.ja).
Implements
Namespace: Ibralogue.Localization
Assembly: .dll
Syntax
public class CsvLocalizationProvider : MonoBehaviour, ILocalizationProvider
Methods
| Edit this page View SourceLoadTable(string)
Loads (or reloads) a translation table for a dialogue asset from Resources. Looks for a TextAsset at the path "{assetName}.{locale}" inside a Resources folder.
Declaration
public void LoadTable(string assetName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | assetName |
Resolve(string)
Looks up a translated string by localization key. Returns null if no translation exists for the key, in which case the engine falls back to the original text from the dialogue file.
Declaration
public string Resolve(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key |
Returns
| Type | Description |
|---|---|
| string |
SetLocale(string)
Changes the active locale. Call LoadTable(string) afterward to load translations for a specific dialogue asset.
Declaration
public void SetLocale(string newLocale)
Parameters
| Type | Name | Description |
|---|---|---|
| string | newLocale |