English
About this handbook

This handbook belongs to the Quartz plugin quartz-multilanguage. And it is built with it: the switcher at the top right comes from there.

This box, too, appears twice in the configuration — once per language.

5.2 – og:locale and html lang

og:locale

<meta property="og:locale" content="de_DE" />
<meta property="og:locale:alternate" content="en_US" />

What social networks read when somebody shares a link. Switched off with seo.ogLocale: false.

Note the underscore: Open Graph writes de_DE, hreflang writes de-DE. The plugin sets both correctly from the same locale field.

<html lang>

That is produced by Quartz, not by the plugin — from the page’s frontmatter field lang. And that field is exactly what the plugin sets during detection, if it is missing.

A small chain follows:

folder name de/  →  detection  →  frontmatter.lang = de-DE  →  <html lang="de-DE">

Writing the field yourself does not get overridden by the detection — it is only set when absent.

code and locale are two things

FieldWhat forExample
codefolder names, file suffixes, frontmatter, data-langde
locale<html lang>, hreflang, og:localede-DE

Without a locale the plugin takes the code — then <html lang="de"> appears. That is valid but less precise: de-AT and de-DE differ in date and number formats.

languages:
  - { code: de, native: Deutsch, locale: de-DE }
  - { code: en, native: English, locale: en-US }

Why screen reader users notice

<html lang> decides which pronunciation a screen reader uses. With the wrong language there, German text is read out in English — incomprehensible, and this is the cheapest accessibility improvement there is.