Pages

Markdown pages

A page written in markdown has a copy in each language, translated whole. Here are this site's, and what it takes, with the lines that do it.

This site's pages

docs/tour.md
en-USThe tourthe original
ar-EGجولةtranslatedFrom: 379ae94ae71a
th-THทัวร์translatedFrom: 379ae94ae71a

What it takes

A copy per language

A page is written once under pages/ and the source language, and each language has its copy at the same path under its own folder, translated whole: headings, text, and the title and description in its frontmatter.

pages/en-US/docs/tour.md
title: The tour
pages/ar-EG/docs/tour.md
title: جولة

Out of date, reported

Each copy records the version of the original it was translated from. When the original changes, vp dev reports the copy as out of date and translates it again, and vp build fails on it, as the column above would show.

packages/void-fbtee/src/check.ts
export const TRANSLATED_FROM = "translatedFrom";

Dates and numbers for each reader

A date or a number in a page isn't written out: it's an island that formats it with Intl for the reader. Each island goes on a line of its own, since the page's HTML is cut at each one.

pages/en-US/docs/tour.md
import Fmt from "../../../src/docs/Fmt.tsx" with { island: "load" }
pages/en-US/docs/tour.md
<Fmt num="1234567.891" />

Used here, and explained on the Components page: langAttrs and useLocales.

The full reference is in void-fbtee's skill.