LocalizationLoader

Loads a project's string table assets and the active/default locale from LocalizationSettings into a LocaleService. The entry point hosts use when a project, play scope or game boots, so every context gets the same behaviour: tables from the asset database, locale from settings.

Remarks

Runs after the project settings are loaded and the asset catalog is indexed. Loading is additive and permissive: a broken table is skipped with a warning rather than failing the host, so a project with one damaged .strings file still runs the rest localized.

Public Methods

Create

public static LocaleService Create(IAppSettings? settings, AssetDatabase? database)

Creates a service for a project and populates it.

Parameters:

  • settings (IAppSettings?): The project settings to read locale defaults from, or null.
  • database (AssetDatabase?): The catalog to load string table assets from, or null.

Returns: LocaleService

  • A ready-to-use service.

Load

public static LocaleService Load(LocaleService service, IAppSettings? settings, AssetDatabase? database)

Replaces the service's tables from the catalog and reselects the active locale. Safe to call more than once: loading a project after switching reverts to the settings' active locale.

Parameters:

  • service (LocaleService): The service to populate in place.
  • settings (IAppSettings?): The project settings to read locale defaults from, or null.
  • database (AssetDatabase?): The catalog to load string table assets from, or null.

Returns: LocaleService

  • service.