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.

Parameters:
NameTypeDescription
rokuLocalestring

Roku locale from roDeviceInfo.GetCurrentLocale()

Returns:

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").

Parameters:
NameTypeDescription
codestring

Locale code in any format (e.g. "fr-ca", "pt-BR", "zh-CN")

Returns:

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

Parameters:
NameTypeAttributesDefaultDescription
isPostLoginboolean<optional>
false

Whether a user is authenticated

serverLanguagestring<optional>
""

Language from server CustomPrefs.language (empty if unavailable)

Returns:

Resolved locale code in standard format (e.g. "fr_CA", "en_US", "zh_Hans")

Type: 
string