Class Localization
Main API facade for accessing and managing AI-powered spreadsheet tables. Provides centralized access to database and localization table management.
Inherited Members
Namespace: Glitch9.AIDevKit.Sheets
Assembly: Glitch9.AIDevKit.Sheets.dll
Syntax
public static class Localization
Properties
| Edit this page View SourceCurrentLocale
The currently set Locale for the application. This is not EnUS. This is the Locale that the user has selected.
Declaration
public static Locale CurrentLocale { get; set; }
Property Value
| Type | Description |
|---|---|
| Locale |
IsInitialized
Gets a value indicating whether the localization system has been initialized.
Declaration
public static bool IsInitialized { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Sheets
The localization tables that are loaded into the application. The key is the table name and the value is the SpreadsheetTable.
Declaration
public static IReadOnlyDictionary<string, ILocalizationSheet> Sheets { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, ILocalizationSheet> |
Methods
| Edit this page View SourceInitialize(params ILocalizationSheet[])
Initializes the localization system with the specified preloaded tables.
Declaration
public static void Initialize(params ILocalizationSheet[] preloadedSheets)
Parameters
| Type | Name | Description |
|---|---|---|
| ILocalizationSheet[] | preloadedSheets | The tables to preload into the localization system |
RegisterEventCallback<T>(Action<T>)
Registers a callback to be invoked when a localization event occurs.
Declaration
public static void RegisterEventCallback<T>(Action<T> callback) where T : LocalizationEvent
Parameters
| Type | Name | Description |
|---|---|---|
| Action<T> | callback | The callback function to invoke when the event occurs |
Type Parameters
| Name | Description |
|---|---|
| T | The type of localization event to listen for |
RegisterEventHandler<T>(IEventHandler<T>)
Declaration
public static void RegisterEventHandler<T>(IEventHandler<T> handler) where T : LocalizationEvent
Parameters
| Type | Name | Description |
|---|---|---|
| IEventHandler<T> | handler |
Type Parameters
| Name | Description |
|---|---|
| T |
RegisterSheet(ILocalizationSheet)
Registers a table with the appropriate table manager based on its category.
Declaration
public static void RegisterSheet(ILocalizationSheet preloadedTable)
Parameters
| Type | Name | Description |
|---|---|---|
| ILocalizationSheet | preloadedTable | The table to register |
UnregisterEventCallback<T>(Action<T>)
Unregisters a previously registered localization event callback.
Declaration
public static void UnregisterEventCallback<T>(Action<T> callback) where T : LocalizationEvent
Parameters
| Type | Name | Description |
|---|---|---|
| Action<T> | callback | The callback function to unregister |
Type Parameters
| Name | Description |
|---|---|
| T | The type of localization event |
UnregisterEventHandler<T>(IEventHandler<T>)
Declaration
public static void UnregisterEventHandler<T>(IEventHandler<T> handler) where T : LocalizationEvent
Parameters
| Type | Name | Description |
|---|---|---|
| IEventHandler<T> | handler |
Type Parameters
| Name | Description |
|---|---|
| T |
UnregisterSheet(string)
Unregisters a table from the specified category manager.
Declaration
public static void UnregisterSheet(string tableName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | tableName | The name of the table to unregister |