Language is the metadata field that records which human language a file uses. In a document or an e-book, the Language field names the language of the text. In an audio or video file, the field usually names the language that is spoken or sung in one track.
Which files carry it
Each file format stores the language in its own place:
- MKV videos store a language for each track, so every audio and subtitle track has its own value
- MP4 and MOV videos store a language code in the media header of each track
- MP3 files can carry the language in their ID3 tag, in the frame
TLAN - WAV and AVI files can carry the language in their RIFF INFO block, in the field
ILNG - PDF files can store the default language of the whole document in the entry
Lang - EPUB e-books must name at least one language in their package metadata, in the element
dc:language - Office files such as DOCX, XLSX, and PPTX can store the language in their document properties
- JPG, TIFF, and other files with an XMP block can store the language in the XMP field
dc:language
What the values look like
Files use 2 main code systems. ISO 639-2 gives each language a code of 3 letters. BCP 47 uses a 2-letter code where one exists and can add a region after a hyphen.
engis English in ISO 639-2, andenis English in BCP 47freandfraare both French, because ISO 639-2 has a bibliographic code and a terminology code for some languagesgeranddeuare both Germanen-USis English as used in the United Statesfre-cais Canadian French in the older form that MKV files use
Letter case has no meaning in a BCP 47 tag, so en-us and en-US name the same language. By convention, you write the language part in lowercase and the region part in capital letters.
ID3 tags use the 3-letter codes, and EPUB books use BCP 47 tags. An MKV track can hold both forms, and programs must then ignore the 3-letter code. A report made with FFmpeg lists the value as a tag of each stream, such as language=eng.
Special language codes
The code und stands for undetermined. ISO 639-2 provides it for content in a language that cannot be determined.
ISO 639-2 has more special codes. mul means multiple languages, and zxx means that there is no language content at all. Inside ID3 frames such as comments and lyrics, the string XXX marks an unknown language.
Why it matters
Media players read the track language to choose an audio track for you. If you set French as your preferred language, the player selects a track whose language is French. For subtitles, the player also checks flags such as Hearing Impaired.
A missing value can mislead. In an MKV file, a track with no Language element counts as English, because the default value is eng.
In documents, the language helps screen readers. With the right Lang value, a screen reader can load the correct pronunciation rules for a PDF. A PDF can also mark a single phrase with another language, such as es-MX for Mexican Spanish inside English text.
An EPUB book can list several languages. Reading systems then treat the first one as the main language of the book.