Languages
Portal speaks six languages:
lang: | Language |
|---|---|
en | English |
nb (or no) | Norwegian Bokmål |
nn | Norwegian Nynorsk |
sv | Swedish |
da | Danish |
de | German |
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:
| Crate | Areas |
|---|---|
content | page, dates (the browser loads these) |
core | schedules, map, handbook, mail |
bratac | build, 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:
- Add it to
Langincrates/content/src/i18n.rs, with its code and its fallback. - Write its files beside the others.
- 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.