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

     | |__/module-developer
     |   |__/i18n
     |   |   |-- de_DE.csv
     |       |-- en_US.csv
     |       |-- es_ES.csv
     |       |-- fr_FR.csv

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

"Please wait...","Por favor, espere..."

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

php bin/magento i18n:collect-phrases -o "/var/www//magento2/app/code/ExampleCorp/SampleModule/i18n/es_ES.csv" /var/www/html/magento2/app/code/ExampleCorp/SampleModule

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

    "name": "magento/language-en_us",
    "description": "English (United States) language",
    "version": "100.2.0",
    "license": [
    "require": {
        "magento/framework": "101.0.*"
    "type": "magento2-language",
    "autoload": {
        "files": [

Sample registration.php


Sample language.xml

<?xml version="1.0"?>
<language xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd">

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 *