Skip to content

Languages

Sioul speaks your language, English and French first. The core decides and returns facts (lanes, reasons, counts), and one translation layer turns them into sentences (crates/sioul-core/src/i18n.rs).

How to read and write the .ftl files, and how the code asks for a message: Strings: Fluent.

Why Fluent

Translations use Project Fluent, Mozilla's system.

  • It handles agreement as well as plurals. French must say "une lettre est arrivée" but "un code est prêt"; gettext's plural forms alone cannot express that.
  • Each language decides its own grammar in its own file: the code passes the number, and the number in words in the masculine and the feminine, and each language picks what it needs.

Files

  • One file per language: crates/sioul-core/locales/<language>/sioul.ftl, built into the program.
  • English stands in for any message a translation lacks.
  • A test checks that every language has every message, and that every file parses.
  • tools/check-messages.py checks that every message the code asks for by its name (QML sioul.text("…"), Rust text("…"), say("…")) exists in each language, and French typography (narrow no-break spaces, ’); --unused lists the messages never asked for by name (some are built at run time, "area-" and a kind). It fails when something is missing, so CI runs it.

Conventions

  • Counts:
    • $n is the number, for plural selection;
    • $count and $Count are it in words, lowercase and capitalised;
    • $countf and $Countf are the feminine forms;
    • small numbers are written as words, as a calm sentence says them.
  • Short-lived secrets: $kind, $Kind, and $akind with its article ("a code", "un code").
  • Typography belongs to each language: French puts a narrow no-break space before : ; ! ?, and uses typographic apostrophes and commas in decimals.
  • Plain, literal language in every language: no idioms, buttons that say what they do (research.md, §10).
  • "Device" and "computer": "device" wherever a text says where data stays or which of your machines does something; "computer" only in a contrast with a phone, for a part that exists on computers only (Qt WebEngine's sites), for the kind of program Sioul is (a desktop application), and in measurements made on a computer. French follows the same rule with « appareil » and « ordinateur ».
  • A kind of thing is « type » in French, never « sorte » (attention.md, decision 26; the tests of attention.rs check it).

Dates and numbers

Day and month names come from the translation files for now. Full regional formats (CLDR, through ICU4X) come when a language needs more than names and separators.

Detection is not the interface's language

The detectors (one-time codes, dates in letters, projects' routes) read the languages of the mail you receive, whatever the interface's language. The code detector reads French and English today.

The Qt interface

QML displays strings it gets from the core: one catalogue, not two.

Translating

  • AI drafts the missing strings, marked for review, then a person checks them (the workflow Ansel's documentation uses).
  • Weblate supports Fluent, for when translators join.