Translations

The application enables you to localize your store for multiple regions and markets. We improved the localization and customization of instances by making translation dictionaries easier to update and by maintaining a reduced amount of code coupling and duplication.

Also, we accept contributions using CrowdIn for translations. The project may include package creation and further support using the contributed translations.

Terms

A translation dictionary is a comma-separated value (.csv) file with at least two columns: the original phrase in the en_US locale and a translation of that phrase in an another locale. Sample translation from English (en_US) to German (de_DE):

"Add to Cart","Zum Warenkorb hinzufügen"
"Add to Compare","Hinzufügen um zu vergleichen"
"Add to Wishlist","Zum Wunschzettel hinzufügen"
"Additional Product Info","Zusätzliche Angaben zum Produkt"
"Address","Adresse"
"Address %1 of %2","Adresse %1 von %2"

UI text strings are the text elements in the Admin, including field names, instructions, notifications, and table and grid labels. When localizing, you replace these strings with translation dictionary content.

A language package is basically a collection of translation dictionaries for a particular language together with meta-information. You can also distribute language packages to other merchants if you wish. More information about language packages.

data-variant=info
data-slots=text
To create a language package, the .csv file requires additional columns that specify the themes or modules in which the translations were found. For more information, see Generate a translation dictionary.

Benefits

Localizing storefronts and the Admin panel gives your company global presence for support and sales.

Depending on your needs, you can use the existing language packages, translate by yourself, or contribute.

Programming notes

Theme dictionaries

You might need to add a dictionary for the default language (en_US) in the following cases:

For an example of creating a dictionary for a theme for both cases, see Example theme translation dictionary.

Manually translation

To translate names, titles, and phrases:

  1. Generate a dictionary of your instance using the translation dictionary tool. Fully review Translation dictionaries and packages to understand all steps, commands, and best practices for generating the dictionary.
  2. Translate the terms.
  3. If desired, package your translations in a language package.
data-variant=info
data-slots=text
Only one variant of translation can be used for a word or phrase in a package. Otherwise, the application returns an error.

Anyone can submit inline translations on the storefront using the Text Editor. These inline translations overwrite a dictionary and save to your database (not in an instance's dictionary). Inline translations are theme-specific and do not apply if another theme is assigned.

To save and reuse translations, we recommend localizing in a dictionary.

Translation dictionaries

The application translates words and phrases when all of the following conditions are met:

The application automatically assembles translation dictionaries located in the modules' i18n directory into a dictionary per language. For example, Brazilian Portuguese (pt_BR) translation dictionaries might be located in module and theme directories similar to the following:

data-variant=info
data-slots=text
<Magento_Checkout_module_dir> stands for the Magento_Checkout module directory. The location of this directory depends on the way the application was installed. See Conventional notations for paths to modules and themes for details.

Assembling the preceding pt_BR.csv files across all modules and the current theme results in a Portuguese translation of the entire application area (storefront or the Admin).

Dictionary generator tool

You can generate a translation dictionary to use by itself (for example, to translate words and phrases in a custom module) or for use by a language package. For more information, see [dictionary generator tool - We intend to publish more information on this technique at a later time].

Language packages

data-variant=success
data-slots=text
Existing language packages can be installed using Composer like any other extension. You can search for package names on Packagist.

The application enables you to create the following types of language packages:

In addition to the .csv file that contains the language dictionary, the language package contains meta-information:

Open-source translations project

The Community Engineering team accepts translation contributions through the [CrowdIn project] to localize all UI strings. Various Meet Magento and Contribution Day events include developers contributing translations.

  1. Create a CrowdIn account and join the [CrowdIn project].
  2. Browse and select a language. A percentage displays tracking translation progress overall and per section of the Admin.
  3. Expand and locate an area of UI text strings to translate. Strings marked red need a translation, and marked green have existing translations.
  4. Enter or review translations for strings as described in the CrowdIn knowledge base.

Admins will review and approve translations as available. The project may include package creation and further support using the contributed and approved translations.

If you need help understanding the context or meaning of a UI string, or have questions about the project, chat with us in the Community Engineering Translations Slack channel. To join, send a request to engcom@magento.com or self signup.