LanguageResourceLoader class

Load all LG resource and split them into different language groups.

Methods

fallbackLocale(string, string[])

Get the fallback locale from optional locales.

groupByLocale(ResourceExplorer)

Group LG resource by locale.

parseLGFileName(string)

Parse LG file name into prefix and language.

Method Details

fallbackLocale(string, string[])

Get the fallback locale from optional locales.

static function fallbackLocale(locale: string, optionalLocales: string[]): string

Parameters

locale

string

Current locale

optionalLocales

string[]

Optional locales.

Returns

string

The final locale.

groupByLocale(ResourceExplorer)

Group LG resource by locale.

static function groupByLocale(resourceExplorer: ResourceExplorer): Map<string, Resource[]>

Parameters

resourceExplorer

ResourceExplorer

The resource explorer to use.

Returns

Map<string, Resource[]>

The dictionary of grouped locale.

parseLGFileName(string)

Parse LG file name into prefix and language.

static function parseLGFileName(lgFileName: string): { language: string, prefix: string }

Parameters

lgFileName

string

LG input file name.

Returns

{ language: string, prefix: string }

The name and language.