Skip to content
EPUBCheck · Package document (OPF)

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

  1. Read the tag EPUBCheck quotes and find where it is used.
  2. Replace it with a BCP 47 code: en, en-US, es, pt-BR, ja, ar.
  3. 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-091 The item href URL must not have a fragment identifier.
  • OPF-093 The "media-type" attribute is required for linked resources located in the EPUB container
  • OPF-090 It is encouraged to use MIME media type "…" instead of "…".
  • OPF-094 The "media-type" attribute is required for "…" links.
  • OPF-089 The "alternate" link rel keyword cannot be paired with other keywords.
  • OPF-095 The "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.

FAQ

What does EPUBCheck OPF-092 mean?

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.

Is OPF-092 an error?

OPF-092 is reported as error by default. 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.