EPUBCheck OPF-092: malformed language tag
Updated:
EPUBCheck OPF-092 is an error message: “Language tag "…" is not well-formed: ….” A language tag in the EPUB is not a well-formed BCP 47 tag. EPUBCheck quotes the tag and the reason; reading apps use the language for hyphenation, fonts and text-to-speech.
The official message
Language tag "%1$s" is not well-formed: %2$s
- Default severity
- Error. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.
- EPUBCheck version
- 5.4.0
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- Language names instead of codes, such as "English".
- Underscores instead of hyphens, such as "en_US".
- Typos or extra spaces in dc:language, xml:lang or lang attributes.
How to fix it
- Read the tag EPUBCheck quotes and find where it is used.
- Replace it with a BCP 47 code: en, en-US, es, pt-BR, ja, ar.
- Use the same code in dc:language and in the lang and xml:lang attributes of the content.
When it's not this
If dc:language is missing entirely, EPUBCheck reports a schema error (RSC-005) instead.
Terms used here
Other OPF messages
OPF-091The item href URL must not have a fragment identifier.OPF-093The "media-type" attribute is required for linked resources located in the EPUB containerOPF-090It is encouraged to use MIME media type "…" instead of "…".OPF-094The "media-type" attribute is required for "…" links.OPF-089The "alternate" link rel keyword cannot be paired with other keywords.OPF-095The "media-type" attribute of "voicing" links must be an audio MIME type, but found "…".
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.