hreflang Language of the Link Target

Language of the target to which an external link is pointing. A processor following the link would expect to find a document in the language named.

Usage/Remarks

The @hreflang attribute does not name the language of:
  • the content of the link itself,
  • the current article, or
  • the structural object in which the link is embedded.
The @hreflang attribute names the language of the document to which the link is pointing, the target of the link.
Script and Language Codes
The value of this attribute should conform to IETF RFC 5646 (https://tools.ietf.org/html/rfc5646). For most uses, a primary-language subtag such as “fr” (French), “en” (English), “de” (German), or “zh” (Chinese) is sufficient. These values are NOT case sensitive, but current best practice uses all lower case. In addition to the primary-language subtag, the value of this attribute may contain other subtags as well. Values for the various subtags (which can be used in certain combinations) can be obtained from the IANA Language Subtag Registry: https://www.iana.org/assignments/language-subtag-registry
In some languages, script codes are also critically important; for example, in Japanese, there is the need to express whether a name is in Kanji as opposed to in Kana (Hiragana or Katakana) to determine sort keys. Best practice is to use the full language-code-plus-script-code as the value for @hreflang. In JATS’ use of both language and script tagging as values for @hreflang, JATS is following the IETF (Internet Engineering Task Force) best practice guideline Network Working Group Request for Comments: 5646 [Tags for Identifying Languages, A. Phillips and M. Davis, Editors, September 2009]. That document defines a language tag as composed of (in part):
  1. A language code Language (typically using the shortest ISO 639)
  2. Potentially followed by a hyphen and then a script code (Script using the ISO 15924 code)
  3. Potentially followed by a hyphen and a region code (Region using the ISO 15924 code)
Some sample values of @hreflang for Chinese and Serbian illustrate this complexity:
  • Language subtag plus Script subtag: @hreflang="zh-Hant" (Chinese written using the Traditional Chinese script)
  • Language subtag plus Script subtag: @hreflang="zh-Hans" (Chinese written using the Simplified Chinese script)
  • Language-Script-Region: @hreflang="zh-Hans-CN" (Chinese written using the Simplified script as used in mainland China)
  • Language-Script-Region: @hreflang="sr-Latn-RS" (Serbian written using the Latin script as used in Serbia)
Thus, for example, the following are among the expected values of @hreflang for Japanese, incorporating both a language (“ja”) and a script type:
  • @hreflang="ja-Hira" (Japanese written in Hiragana)
  • @hreflang="ja-Hrkt" (Japanese written in Hiragana + Katakana)
  • @hreflang="ja-Jpan" (Japanese written in Han + Hiragana + Katakana)
  • @hreflang="ja-Hani" (Japanese written in Kanji (Hanzi, Hanja, Han))
  • @hreflang="ja-Kana" (Japanese written in Katakana)
OPTIONAL on many elements; click for list and usage
Value Meaning
An alphanumeric string, which may include hyphens An abbreviation for a natural language (such as “en” for English or “de” for German) or for a language and a script (“ja-Kana”).
Restriction @hreflang is an optional attribute; there is no default.
Tagged Sample

A related article in German

...
<related-article id="ra1" related-article-type="alt-language" 
  hreflang="de" xlink:href="https://dx.doi.org/10.5414/ALP33164" ext-link-type="doi"/>
...