Search code examples
magentointernationalizationmagento2magento-2.0

Magento 2 installing language packs (nl_NL translation)


I currently have a fresh Magento 2 installation. A basicly have a store setup that is configured for the Dutch market.

I've read the Magento 2 devdocs on installating Language Packs (http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/translations/xlate.html), although the documentation seems clear, I still have some questions.

Magento 2 comes with a pre-installed Dutch Language pack, located in vendor/magento/language-nl_nl. But the language pack does not contain any translated phrases.

I created a *.csv file with the Magento console, wich collected all phrases from the vender/magento dir source files. I suppose this file is meant to be used for distribution to translaters.

After a complete translation there are several options, and I doubt wich one fitch best in my situation;

  1. Create a theme and store a nl_NL.csv file insise the theme`s i18n dir
  2. Use the Magento command line tool to pack my translated phrases in a Magento directory

Option 1 seems to have a drawback, because my Dutch translations are not directly related to the current theme, but for the store with the configured nl_NL locale.

Options 2 is unclear to me. The Magento command i18n:pack command breaks up my nl_NL.csv source file perfectly into vendor/module/i18n/nl_NL.csv files. But packing it in the vendor/magento/ dir seems not an option because of modularity problems.

Wich steps do I have to take to create a global Dutch translation that is not related with the displayed theme, is modular and can easily be distributed with amongst all my Magento 2 Projects?


Solution

  • After completing translation, you can create a "language package" under app/i18n. Folder naming conventions are <vendorname>/<language_code>. It should contain the following files - composer.json - language.xml - registration.php

    Reference: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-i18n.html#config-cli-subcommands-xlate-example2