0

According to the Magento documentation, I should be able to create a translation csv file by calling bin/magento i18n:collect-phrases command. I have tried all variations of the following

bin/magento i18n:collect-phrases -o "path/to/my/file.csv" -m
bin/magento i18n:collect-phrases -o "path/to/my/file.csv" path/to/my/module
bin/magento i18n:collect-phrases --output="path/to/my/file.csv" "path/to/my/module"
bin/magento i18n:collect-phrases --output="path/to/my/file.csv" --magento

But I always get the same error

[InvalidArgumentException]                                
Directory path is needed when --magento flag is not set. 

i18n:collect-phrases [-o|--output="..."] [-m|--magento] [directory]

I feel like the documentation is totally wrong, or the command is broken.

3

Try the following, it has been fully tested -:

php bin/magento i18n:collect-phrases -o "app/code/CompanyName/ModuleName/i18n/en_US.csv" "app/code/CompanyName/ModuleName/"

You should see the following message

Dictionary successfully processed.

| improve this answer | |
0

Give a try

php bin/magento i18n:collect-phrases -o "path/to/my/file.csv" -m "path/to/my/module"
| improve this answer | |
  • I tried that one also and I am still getting the same error. It doesn't seem to have anything to do with the paths, it just is not liking the command for some reason. – Metropolis Oct 12 '17 at 14:39

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.