Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

You need to add de_DE.csv to your module's i18n directory. Structure will

app/code/[vendor]/[module]/i18n/de_DE.csv

This is first way. You can also add de_DE.csv to you theme as well.

First you need to create i18n directory inside the module so the structure is

/app/code/{whatever namespace you use}/Opc/i18n

Then generate the dictionary with magento shell tool:

php bin/magento i18n:collect-phrases -o app/code/[whatever namespace you use]/Opc/i18n/en_US.csv app/code/[whatever namespace you use]/Opc/

Use proper folder inctead of 'whatever namespace you use'. Now you have full dictionary for the module.

Finally duplicate the en_US.csv file in the i18n directory and rename it to es_MX.csv.

Translate the content, clear caches and the phrases will be translated.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top