2

After reading the complete translation documentation (here), I still have some questions / problems. The end goal is to create translations for my magento2 installation.

I run the following command to create a translation dictionary:

php bin/magento i18n:collect-phrases -o "translations.csv" -m c:\xampp\htdocs\magento2\

Where magento2 is the root path of my magento installation. Please note the -m that is required to build a translation pack. If I ommit this parameter, the generated output is 400kb+ (but it contains only 2 columns). If I add the parameter, I only get a 4kb file (it contains the correct 3 columns format). Am I missing something here?

Pastebin (with -m): http://pastebin.com/ssCMaKGw

Pastebin (without -m): http://pastebin.com/cfJGT2tS

Then for a theme translation, I can ommit the -m parameter and after I made the translations for the default luma theme, it's not replacing anything. I've changed my locale in administration to the correct one and also flush cache, rebuilt indexes.

php bin/magento i18n:collect-phrases -o "app/design/frontend/Magento/luma/i18n/nl_NL.csv" app/design/frontend/Magento/luma

5
  • How many rows do you have in each file? With -m and without?
    – Maddy
    Commented Dec 23, 2015 at 16:09
  • 6761 without -m, 29 with -m. I'll add some pastebins to the question.
    – emp
    Commented Dec 23, 2015 at 16:15
  • We just merged a fix related to this tool, please check it. Also, behavior or -m flag has been modified. Please stand by for doc changes related to that.
    – Maddy
    Commented Dec 23, 2015 at 22:47
  • I will try it out tomorrow and keep you up to date. Thanks for looking into it.
    – emp
    Commented Dec 24, 2015 at 12:47
  • The updated command is available on the develop branch. The change was to redefine -m as searching the Magento codebase. The optional pack parameter was removed also. Commented Dec 24, 2015 at 14:15

1 Answer 1

2

I can confirm the -m command is working now with the updates that were committed on the development branch. Thanks for this @steve-johnson & @maddy.

Generated a 762Kb file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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