Skip to main content

Module language

Module language 

Source
Expand description

Language codes as files write them: ISO 639-2 in streams (eng, and both ger and deu), often ISO 639-1 in subtitle file names (en). same_language treats all spellings of one language as equal.

Functions§

bcp47
A language code as BCP 47 (HLS’s LANGUAGE) writes it: the two-letter code where the language has one (eng and en are en), else the code as it is, lowercased.
iso639_2
A language code as ISO 639-2 writes it, three letters, the bibliographic code where there are two (en and eng are eng, de is ger): what MP4’s language field holds, and ffmpeg’s MP4 muxer writes und for any other. A code not known stays as it is, lowercased.
of_tag
The language a device’s tag names, as bcp47 writes it: en-US, and en_US as a POSIX locale has it, are en. None for a tag that names none (und, mul, mis, zxx), a private one (x-foo) or anything else that is no language: a track tagged und must not match it.
same_language
Whether two language codes name the same language.