Methods

(static) languageEnglishFallbacks() → {object}

Comprehensive English-name fallback for ISO 639-2 codes that the app does NOT have a UI translation for (e.g., "lat" Latin, "swa" Swahili). Used as tier 2 by resolveLanguageName() — translatable languages always go through translate() first; this only fires when no LanguageX key exists for the resolved base code, ensuring no recognized 3-letter code ever displays raw.

Names are the official ISO 639-2 forms. They are intentionally NOT routed through the i18n pipeline: these languages are unlikely to be a UI locale for our users, so the maintenance cost of translating "Akkadian" into Polish (etc.) outweighs the UX benefit. Users see the English name in any UI when an audio/subtitle track is in one of these less-common languages.

Cached on the caller's m scope after first build.

Returns:
  • AssocArray of 3-letter ISO 639-2 code to English name
Type: 
object

(static) languageTranslationKeys() → {object}

Maps a normalized 2-letter base code (or a 3-letter code for languages without a 639-1 equivalent) to the translation key used by translate() for the localized language name. Keys must exist in locale/custom/en_US.json.

Region/script suffixes (e.g., "_BR", "_Hant") are stripped before lookup by resolveLanguageName(), so en_GB and en_US both land at "en" → LanguageEn.

Cached on the caller's m scope after first build.

Returns:
  • AssocArray of base code to translationKeys.* string
Type: 
object

(static) mediaLanguageAliases() → {object}

Maps 3-letter ISO 639-2 codes (T = terminological, B = bibliographic) and deprecated ISO 639-1 codes to the 2-letter base codes used by the app's translation system. Only languages the app supports as a UI locale are covered (see scripts/update-translations.cjs LANGUAGE_METADATA).

Why this exists: ffmpeg/Jellyfin pass through whatever the container metadata holds — most modern files use 639-2/T (e.g., "fra"), older or hand-tagged files use 639-2/B (e.g., "fre"), and some use 639-1 ("fr" already, no alias needed). MediaStream.Language is therefore not a single standardized format; this map normalizes to one canonical form.

3-letter codes that have no 2-letter ISO 639-1 equivalent (ckb, fil, gsw, jbo, kab) are not aliased here — they're looked up directly in languageTranslationKeys() under their 3-letter form.

Cached on the caller's m scope after first build to avoid reallocating on every audio/subtitle render.

Returns:
  • AssocArray of 3-letter alias to 2-letter base code
Type: 
object