Tech News
← Back to articles

Fluent: A Localization System for Natural-Sounding Translations

read original related products more articles

The English Translation

In Fluent, most messages are simple text strings identified by an identifier. In the first message in the example, tabs-close-button is the identifier and Close is the value.

Sometimes, translations require a little bit of logic to sound right in the target language. In the tabs-close-tooltip message, the correct variant of the translation depends on the value of the $tabCount variable. The names of the variants, [one] and [other] , are standard names of the plural categories defined by the Unicode in CLDR.

On the other hand, when no logic is required, translations in Fluent stay simple. The tabs-close-warning message appears in Firefox when the user tries to close a window with more than one tab. The message is only displayed when the tab count is 2 or more, and so in English, the word tab will always appear as the plural tabs.

-sync-brand-name is a special kind of message in Fluent, called a term. Term identifiers always start with a dash. Terms can be referenced by other messages, but cannot be displayed directly in the app. Referencing terms is a powerful tool for ensuring consistency. Once defined, a translation can be reused in other translations.