Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Languages

Portal speaks six languages:

lang:Language
enEnglish
nb (or no)Norwegian Bokmål
nnNorwegian Nynorsk
svSwedish
daDanish
deGerman

site.yaml’s lang: picks one by its first part, so nb-NO is Bokmål and de-AT German. Any other code gets English.

The language covers every word portal says itself:

  • the page’s buttons, notices and refusals;
  • dates, times and how long until something starts;
  • the mails portal writes (invites, suggestions, events);
  • the handbook and the map;
  • the setup kit’s interview, the mails it sends and the sites it writes.

Your content stays in the words you wrote.

A phrase a language lacks comes from its fallback: Nynorsk from Bokmål, every other language from English.

Where the words are

Each part of portal keeps its words in Fluent files, locales/<code>/<area>.ftl:

CrateAreas
contentpage, dates (the browser loads these)
coreschedules, map, handbook, mail
bratacbuild, interview, mail

A new site’s README is crates/bratac/templates/questions/README.<code>.md.

A phrase names what goes into it ({ $group }) and can follow a number ({ $n -> [one] 1 day *[other] { $n } days }). { CAPITALIZE($name) } starts a sentence with a name.

Changing a word, adding a language

To change a word, edit it in the file for every language.

To add a language:

  1. Add it to Lang in crates/content/src/i18n.rs, with its code and its fallback.
  2. Write its files beside the others.
  3. List it in each part’s files!.

Each part has a test, every_language_says_what_english_says. It names every phrase a language is missing, and every one that names other variables than English.

The Nynorsk, Swedish, Danish and German words are a first draft. Have someone who writes the language read them before a site goes live in it.