Methods
(static) mapRokuLocaleToTranslationLocale(rokuLocale) → {string}
Convert Roku's locale format to our standard format. Roku sends underscore format (e.g. "en_US", "fr_CA", "zh_CN"). Most pass through directly since they already match our convention, except Chinese locales which use script codes instead of region codes.
| Name | Type | Description |
|---|---|---|
rokuLocale | string | Roku locale from roDeviceInfo.GetCurrentLocale() |
Locale code in standard format
- Type:
- string
(static) normalizeLocaleCode(code) → {string}
Normalize any locale code to our standard filename convention. Handles input from Jellyfin server, user settings, or any external source. Convention: base languages lowercase (e.g. "fr"), regional variants use underscore with uppercase region (e.g. "fr_CA"), Chinese uses script codes (e.g. "zh_Hans", "zh_Hant", "zh_Hant_HK"), numeric regions stay numeric (e.g. "es_419").
| Name | Type | Description |
|---|---|---|
code | string | Locale code in any format (e.g. "fr-ca", "pt-BR", "zh-CN") |
Normalized locale code matching our filename convention
- Type:
- string
(static) resolveTranslationLocale(isPostLoginopt, serverLanguageopt) → {string}
Determine which locale to load using the fallback cascade. Pre-login (isPostLogin=false): device locale -> en_US Post-login (isPostLogin=true): user setting -> server language -> device locale -> en_US
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
isPostLogin | boolean | <optional> | false | Whether a user is authenticated |
serverLanguage | string | <optional> | "" | Language from server CustomPrefs.language (empty if unavailable) |
Resolved locale code in standard format (e.g. "fr_CA", "en_US", "zh_Hans")
- Type:
- string