Skip to the text

Docs Reference

Languages

One generated page per language, read from its pack: languages/index.md. Each page lists the quote marks and nesting, the sentence dash, orphan letters, short words, abbreviations, % and currency spacing, number format, and the sources the pack was written from.

The engine has 26 language packs, src/core/lang/<code>.ts: the 24 official languages of the EU (bg cs da de el en es et fi fr ga hr hu it lt lv mt nl pl pt ro sk sl sv), Ukrainian (uk) and Swiss usage (ch). Lang is derived from the packs, and en is the default when none is given. American English is not a pack: it is the option quoteStyle: 'us' (“…” with ‘…’ inside) on any language.

Read this first

Quote marks

A quotation nested deeper than the levels a pack lists starts over from the first. Source marks may be curly, low, straight or guillemets; any mix is read, and the marks of the language and level are set. The literary register uses the pack’s literary quotes where it has them (British English ‘…’ with “…” inside) and the display quotes otherwise.

quoteStyle: 'us' sets “…” with ‘…’ inside for any language and takes precedence over both the language’s marks and the literary register. The default, 'language', keeps each language’s own marks. English’s own default is «…», which is this package’s house style; the benchmark counts it as a failure against its own check (see bench/RESULTS.md).

German nested quotes are »outer ›inner‹ outer«. The other common German style, „outer ‚inner‘ outer“, is not implemented.

Dialogue dash

Where a language writes a line of dialogue with a dash instead of quotation marks, a paragraph that opens with a hyphen, en dash or em dash and a space is such a line (dash.dialogue), in both registers: the dash becomes the language’s own, followed by a no-break space (—~Привіт), or attached with no space in Spanish (—¿Esperamos?). The pack field is dialogueDash; each language page shows it.

Only the start of the text (blockStart), and not when a later line of the same paragraph also opens with a dash: a dash after a line break is as likely a list marker, and a paragraph of such lines is a list. A single line that opens with - in one of these languages is read as dialogue, so a one-item list written that way gets the dash too. Sources per language are in sources.md.

Short words and one-letter words

Two things keep a short word off the end of a line, and only the first runs by default:

Not implemented

Something wrong or unclear here? Report an issue.