Back to start

Languages in the host system

This page is for whoever wires Flowweaver in. Everything here is the host's responsibility, and none of it has a default we could guess for you — which is why the page exists. It runs real code; the boxes below show what the calls actually returned, not what they ought to.

Translating the content into a language must never require the tool to be translated into the same language.

Three axes, moving independently of one another:

Which languages are offered
Your list. Without it the editor's language field stays free text.
The guide's content
The editor's and the translator's. Any language at all.
The tool's language
Swedish or English, plus whatever you register yourselves.

1. Which languages may a guide be offered in?

declareLocales is the only thing that turns the editor's language choice into a list. Without the call the field stays free text — and that is right, because “no decision taken” is a different thing from “no languages”.

2. A language pack from you

registerLocale gives Arabic buttons in every guide, without any editor touching them. The pack below is deliberately incomplete: partly translated stops nothing, and coverageOf says how far it reaches.

A complete pack, in a file of its own

148 keys is the whole surface a visitor meets. That does not belong inline in your setup code — it belongs in a file you can hand to a translator and review in a diff. The call is the same one; only what a visitor ends up reading changes.

3. The guide below is written in English

The source language is in the guide itself (settings.sourceLocale), and it does not have to be Swedish. Change the language and see what happens to the nodes that are not translated yet: they fall back to the guide's source, not on Swedish.

4. The tool's language is its own choice

editor-locale controls the palette, the panel and the menus. It does not follow the content: an English-speaking editor can translate into Arabic with the tool in English. That is the rule at the top of this page, in one setting.

5. Did the setup come out right?

checkSetup reads a mounted element and says what is missing and what it leads to. It is in English on purpose: it is read by whoever wired the library in, not by an editor or a visitor.

Why Flowweaver exists