Magento 2 Language Packages

Magento 2 Language Package Explained

Magento is multi-lingual platform. It helps you to reach customers from different countries. Localization does not require change of codebase. Links to magento 2 language package for multiple languages can be found in the bottom of this article. Typically a developer use translation functionality for one of reasons:

  • localization – exactly when a phrase needs to be translated into different language
  • customization – when phrase needs to be changed. For example – “Add to Compare -> Compare”
  • to prepare your module/theme for localization. More merchants may use your theme if it supports localization.

Magento supports two types of language packages:

  • Translated Module and theme packages. Magento auto-discovers packages included in the i18n directory of a module or theme. When installing themes and extensions, consider checking for multiple language versions to download and use.
  • An entire dictionary in one directory. Use and distribute the dictionary as a standalone component (similar to modules and themes).

Magento 2 module / theme language package

It is basically a dictionary file(s) located in in module or theme. Like

Dictionary file is a comma-separated value file with at least two columns: original phrase from code and translated phrase

If you do follow magento coding standards you can easily create dictionary file using magento console command.

It will collect phrases from your module. Translate 2nd column of a file and it is ready.

Magento 2 language package

Another type of language packages is standalone component which contain entire magento dictionary. In addition to the .csv file that contains the language dictionary, the language package contains meta-information:

  • license.txt license file. Can be omitted
  • composer.json that contains any dependencies for the language package and a mapping to its defined locale
  • registration.php to register your language package as component
  • language.xml to declare a language package.

Sample composer.json

Sample registration.php

Sample language.xml

More information can be found on Magento portal under Create a language package section.

List of available packages

  • ru_RU – Russian Language Package.
  • de_DE – German Language Package.
  • de_CH – Swiss Language Package.
  • fr_FR – French Language Package.
  • da_DK – Danish Language Package.
  • es_AR – Spanish (Argentina) Language Package.
  • es_ES – Spanish Language Package.
  • pt_BR – Portuguese Brazil Language Package.
  • it_IT – Italian Language.
  • nl_NL – Dutch Language Package.
  • pl_PL – Polish Language Package.
  • tr_TR – Turkish Language Package.
  • ro_RO – Romanian Language Package.
  • fi_FL – Finnish Language Package.
  • ko_KR – Korean Language Package.
  • sk_SK – Slovakian Language Package.
  • sl_SI – Slovenian Language Package.
  • en_GB – British Language Package.

Complete CLI commands list – Magento 2 Command-Line Interface (CLI) Commands List

Leave a Reply

Your email address will not be published. Required fields are marked *