Gå til hovedinnhold

Learn kapi › Add languages

One more axis

The same content, the same point, and three languages added.

Compass ships in English at four North Sea terminals, and its operators read Norwegian, German and Dutch. The recipe adds one line to what the first series governed. This lab reads it, reads the context in, and looks at where every language stands before the loop has run.

  1. One line makes it multilingualcat kapi.yamlCompass is the product whose interface strings the monolingual sample governs. The recipe adds target_languages and two gates. The point, the voice and the vocabulary are the ones already in force; the catalogs sit where the site loads them from, so the loop writes straight into the deployed tree.
  2. Read the context inkapi store import ./contextThe context arrives as files again, with two more kinds beside the voice and the terms: approved wording per language, which the loop recycles, and the review record, who approved what and of which text.
  3. Both axes on one screenkapi statusThe source gained a Tide window panel last week, four strings, and no language carries it. That is ordinary work rather than a failure, and it is enough to hold every language behind the ship gate.
  4. The point did not movekapi context site/locales/en-GB.json | head -6Ask the source catalog where it sits and the answer is the one the monolingual sample gives for the same strings: the northsea profile, the app channel, the voice in force. The voice governs the translations too, which is what keeps vessel from becoming ship on the way into another language.
  5. The lifecycle ladderkapi status --locale nbA translation climbs a ladder: draft, translated, approved. Norwegian is translated and mostly approved, German mid-review, Dutch half done and unreviewed. Nothing here is stored as a flag; every number is derived from the files and the record.
  6. What the site may offerkapi status --shipThe ship manifest answers one question per language: may a reader be offered it. Nothing is offered yet. A catalog being present is not a decision; the gate is.
  7. The picker reads one filegrep -n 'ship.json|established|AI' site/language-picker.js | head -8The deployed page builds its language picker from ship.json and nothing else: it offers what is shippable and marks what is translated but not yet established.