Initialization

Basic Initialization

Before using localization features, you must initialize the system:

using Glitch9.AIDevKit.Sheets;

void Start()
{
    Localization.Initialize();
}

Preloading Tables

You can preload specific localization tables during initialization:

// Load tables manually
var uiTable = SheetDatabase.Load<LocalizationTable>("UI");
var itemsTable = SheetDatabase.Load<LocalizationTable>("Items");

// Initialize with preloaded tables
Localization.Initialize(uiTable, itemsTable);

Setting Current Locale

Set the active locale for your game:

Available Locales

Checking Initialization Status

Complete Initialization Example

Runtime Locale Changes

You can change locale at runtime:

Best Practices

  1. Initialize early: Call Initialize() in Awake() or at game startup

  2. Preload tables: Preload frequently used tables for better performance

  3. Check initialization: Always check IsInitialized before using localization in dynamic scenarios

  4. Cache locale: Save player's locale preference to PlayerPrefs

Last updated