Magento 2 – How to Translate Extensions Using Language Packages

extensionslanguage-packagemagento2

I installed the Wirecard extension for our payments. Per default everything is in English but I would like to have it in German. Is there a language file that can be edited ? Preferably not inside the vendor it won't get overwritten in the next update.

Best Answer

You can run this command

bin/magento i18n:collect-phrases path/to/extension/folder -o en_US.csv

this will collect all the texts used in the extension in a file called en_US.csv that will be located in the root folder of your application (mage_dir).

The file will have a set of lines that look like this:

"Text here","Text here"

Just replace what's after the comma (second text) with the German version.

Then rename the file to de_DE.csv and you can place it inside any extension you have because in Magento2 the translations are not per module anymore. All translation files will be picked up and merged into one big translation cache file used everywhere.

Related Topic