Mozilla has published Fluent 1.0 localization system

Submitted by first stable release of the project Fluent 1.0, created to simplify the localization of Mozilla products. Version 1.0 marked the stabilization of markup specifications and syntax. Project achievements extend licensed under Apache 2.0. Fluent implementations prepared in languages Python, JavaScript ΠΈ Rust. To simplify the preparation of files in the Fluent format, we develop online editor ΠΈ Plugin for vim.

The proposed localization system provides opportunities for creating natural-looking translations of interface elements that are not driven into rigid frameworks and are not limited to 1 to 1 translation of reference phrases. On the one hand, Fluent makes it extremely easy to implement simple translations, but on the other hand, it provides flexible tools for translating complex interactions that take into account gender, plural declensions, conjugations, and other language features.

Fluent allows the creation of asynchronous translations, in which a simple string in English can be compared with a rather complex multi-variant translation in another language (for example, β€œVera added a photo”, β€œVasya added five photos”). At the same time, the Fluent syntax that defines translations remains fairly easy to read and understand. The system was originally designed for use by non-technical specialists, which allows the involvement of translators without programming skills in the process of translation and review.

shared-photos=
In {$userGender ->
[male] him
[female] her
*[other] them
} collection
{$userName} {$photoCount ->
[one] new photo added
[few] added {$photoCount} new photos
*[other] added {$photoCount} new photos
}.

The main element of translation in Fluent is the message. Each message is associated with an identifier (for example, "hello = Hello, world!"), which is attached to application code at the point of application. Messages can be either simple text phrases or multi-line scripts that take into account different grammar options and include conditional expressions (selectors), variables, attributes, terms ΠΈ Features (number formatting, date and time conversion). Links are supported - some messages can be included in other messages, and links between different files are allowed. Before assembly, the files with messages are combined into sets.

Fluent provides high error resilience - a poorly formatted message does not corrupt the entire translation file or adjacent messages. You can add comments to add contextual information about the purpose of messages and groups. Fluent is already being used to localize Firefox Send and Common Voice project sites. Last year, the migration of Firefox to Fluent began, at the moment already prepared more than 3000 messages with translations (in total, Firefox has about 13 thousand lines for translation).

Mozilla has published Fluent 1.0 localization system

Source: opennet.ru

Add a comment