English
About this handbook

This handbook belongs to the template Example for QuartzControl. It explains the template and, at the same time, shows everything it can do.

The text here comes from a Markdown file, not from the configuration.

6.7 – Two languages

Quartz knows one locale per site. This template publishes two languages from one vault all the same, with the quartz-multilanguage plugin.

The layout

GermanEnglish
Where the files sitin the root of the vaultunder en/
How the language is detecteddefaultLanguage — nothing matches, so Germanfolder strategy: the first path segment is en
Addresses/formatierung/text/betonung/en/formatting/text/emphasis
File namesGermanEnglish
Tagsformatierung, gestaltung, …formatting, design, …

The German notes did not have to move for this. That is the reason for this cut: the folder strategy could have demanded a de/ as well, but then each of the 133 German notes would have got a new path and each of the 143 wikilinks a correction. A page no strategy matches falls into the default language — that is enough.

The parts

PartWhere
Detection and linkingHow the two languages find each other
The switcher in the headerThe language switcher
What stays monolingualWhere the two languages stop

What else the plugin does

  • <html lang> per page. The plugin writes the locale of its language into every page without a lang of its own. A screen reader changes its pronunciation by it, and the stylesheets of this template hang their explorer rule on it.
  • hreflang and og:locale. Every page with a translation gets <link rel="alternate"> to its siblings and an x-default. The configuration needs baseUrl for that.
  • Notices above the page. Anyone landing on a German page with an English browser language gets a box at the top: “This page is also available in English.” The text is only filled in by the browser and therefore appears in neither the search index nor the description.
  • Dates in the page language. localizeDates: true re-formats every <time> element in the browser — the only thing about the Quartz interface that becomes bilingual without a second build.

One build or two

This site is one build. That keeps the search, the graph and the addresses together, but it costs the interface: everything Quartz labels itself follows configuration.locale and stays German. For that the plugin knows publishLanguages — one build per language, each with its own locale and its own baseUrl. What that means in each case is under Where the two languages stop.

The pages

Read on

This page belongs to Example — the example template for QuartzControl. An overview of every area is on the English home page.

On a narrow screen the navigation is collapsed at the top.