How to Translate FOLIO

How to Translate FOLIO

Basic Info

  • Translation is done by human translators.

  • If you are willing to help with string translations, join the translation team and contact @Peter Murray, he will set you up on lokalise.com.

  • To begin work on translations for a new language or region, contact @Peter Murray.

  • Currently all translators must use the web tool Lokalise (https://lokalise.com/) that shows the English text and a text field for the translation. Lokalise gives advice when the text contains placeholders and offers machine translations as suggestions.

  • See Verified and Unverified how to list entries where the English text is new or has changed.

  • Do you want to use a different online or offline computer aided translation tool (CAT)? Contact @Peter Murray to setup downloading and uploading XLIFF files.

  • You are a developer? Read Explain internationalization and localization.

Translation deployment

Reserved characters

The English messages in en.json may contain replacements for reserved characters. The safest way is to copy them verbatim into the translation. This table lists frequent replacements.

reserved character

replacement

reserved character

replacement

<

&lt;

<

'<

>

&gt;

' (single quote)

'' (two single quotes)

" (double quote)

&quot;

Example:

  • English: Use the &ltrow&gt; XML tag.

  • German: Nutzen Sie den &ltrow&gt;-XML-Tag.

The English messages may contain HTML tags that use reserved characters without replacement. Those should be copied verbatim into the translation.

Example:

  • English: <strong>Warning:</strong> The deletion cannot be undone.

  • German: <strong>Warnung:</strong> Die Löschung kann nicht rückgängig gemacht werden.

If a replacement or a tag exists in the English message but is missing from the translated message (or vice versa) Lokalise warns with the </> icon (placeholder/HTML mismatch icon) on red background to indicate a potential translation error.

The error may break the build pipeline for the UI module.

For advanced users: If the build pipeline for the UI module breaks fork the repository and enable the build-npm.yml GitHub Action workflow in your fork. Manually fix the problem in the .json files of your fork. This should trigger the build-npm.yml workflow. Repeat until the "Run yarn formatjs-compile" step succeeds. Then extract the changed string with a jq query like this (to remove the \ masking) and paste it into Lokalise: jq -r '."harvestables.field.csvConfiguration.help"' < de.json

Language rules

See Language rules in "MOTIF: The FOLIO design system" for the user experience (UX) recommendations and guidelines for the language of text in FOLIO's user interface.

Plural syntax

To support languages with multiple plural forms there is a special syntax for plurals (ICU message syntax, see https://formatjs.io/docs/core-concepts/icu-syntax/#plural-format for details).

Example 1:

English

{count, plural, one {{count, number} record found} other {{count, number} records found}}

German

{count, plural, one {{count, number} Datensatz gefunden} other {{count, number} Datensätze} gefunden}

Polish

{count, plural, one {znaleziono {count, number} rekord} few {znaleziono {count, number} rekordy} many {znaleziono {count, number} rekordów}}

Example 2:

English

{amount, plural, one {These match profile edit will affect {amount, number} associated job profile} other {These match profile edit will affect {amount, number} associated job profiles}}. Please confirm

Portuguese (Brazil)

{amount, plural, one {Essa edição do perfil de correspondência afetará {amount, number} trabalho associado perfil} other {Essa edição do perfil de correspondência afetará {amount, number} trabalho associado perfis}}. Por favor confirme

Spanish (Spain)

{amount, plural, one {Esta edición del perfil de coincidencia afectará a {amount, number} trabajo asociado perfil} other {Esta edición del perfil de coincidencia afectará a {amount, number} trabajo asociado  perfiles}}. Por favor confirmar

Only translate the text within the second level curly braces. Do not translate the key words on the first level curly braces ("count, plural, one", "amount, plural, one") and do not translate the key words on the third level curly braces ("count, number", "amount, number"). The category key words zero, one, two, few, many, other within the first level curly braces must be kept untranslated, see Unicode list of languages and category key words.

Recommendation from https://unicode-org.github.io/icu/userguide/format_parse/messages/#complex-argument-types:

If possible, use complex arguments as the outermost structure of a message, and write full sentences in their sub-messages.

Therefore:

Don't do this:

{count, number} {count, plural, one { record } other { records }} found

Don't do this:

These match profile edit will affect {amount, number} associated job {amount, plural, one {profile} other {profiles}}.

 Complete sentences as shown as example 1 and example 2 above are much easier to read and write and mistakes with curly braces and translated key words are less likely.

Soft hyphen to break words

Browsers break long words that don't fit into small columns. To indicate where to split and insert the hyphen a soft hyphen can be used. The soft hyphen is invisible as long as no break at that position is needed.

This is an example that contains two soft hyphens. Use it for copy & paste: Inventari­sierungs­status

You see how it properly breaks when you change the browser window width.

Lokalise.com displays soft hyphens as red dots:

You cannot use this image for copy & paste, use the example a few lines above instead!

Use soft hyphens only where needed and sparingly. Reasons:

  • Screen reader support is limited (for example NVDA issue).

  • The lokalise.com search slot doesn't support soft hyphens: When entering the word without soft hyphens it doesn't find the word with soft hyphens. And when entering the word with soft hyphens it doesn't find the word with at least one different soft hyphen.

Verified and Unverified

When the English text gets changed Lokalise automatically marks the translation for all other languages as unverified. Filter for unverified translations, update the translation as needed and mark it as verified. Find a detailed explanation at Lokalise Verified and Unverified documentation.

You may enable the toggle Show source difference since last translation.

lokalise-source-changed.png

You may filter unverified translations of a specific module by using “Customize…” filter:

lokalise-customize-filter.png
lokalise-filter-unverified-by-module.png

Spanish

There is an automation in Lokalise to copy changes from es [Spanish] to es_419 [Spanish (Latin America)] and es_ES [Spanish (Spain)]. The copy into es_419 and es_ES is automatically marked as "Unverified" so it can be found easily. If there is already a value in es_419 or es_ES, that value is not overridden when the change is made to es. The intent was to make it easy to set values in both the Latin America and Spain locales while allowing for regional differences.