0

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.

2

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 int he root folder of your application.
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.

  • So, could I place the language file inside whatever module I have in app/code/vendor/module/i18n? – SUPERDEVELOPER Aug 22 '18 at 7:40
  • 1
    yes, you can do that. – Marius Aug 22 '18 at 7:49
  • Sadly it doesn't work for me. M2.2.5. Maybe because the module is a payment method for checkout. – SUPERDEVELOPER Aug 22 '18 at 8:08
1

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.

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.