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.

Metropolis
  • 349
  • 1
  • 16

2 Answers2

1

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.

user63323
  • 11
  • 3
0

Give a try

php bin/magento i18n:collect-phrases -o "path/to/my/file.csv" -m "path/to/my/module"
Nikolas
  • 2,281
  • 11
  • 17
  • 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