i18next-gettext-converter icon indicating copy to clipboard operation
i18next-gettext-converter copied to clipboard

generate pot file from cli

Open nils-hoyer opened this issue 6 years ago • 5 comments

can you please provide a functioning example for generating a .pot file. I tried to execute the command with all necessary parameters:

i18next-conv --pot -l en -s 'path/to/file' -b 'path/to/file' -K

produces: start converting --> reading file from: ..../file.json <-- writing file to: ..../en/file.po file written

nils-hoyer avatar Dec 12 '18 14:12 nils-hoyer

does only pot not work or in general?

jamuhl avatar Dec 14 '18 08:12 jamuhl

the issue only occurs when generating .pot from cli. i18next-conv --pot -l en -s 'path/to/file' -b 'path/to/file' -K

from the API it was working fine. i18nextToPot('ua-UK', readFileSync(source), options).then(save('../locales/ua-UK/translation.pot'));

nils-hoyer avatar Dec 14 '18 08:12 nils-hoyer

so other commands work from CLI? if so i'm sure @perrin4869 will look into this - you might speed this up by providing a PR containing a fix

jamuhl avatar Dec 14 '18 08:12 jamuhl

Tried to create a .pot file using the CLI and got the same issue. Did a quick check on the code. This condition will be triggered when no target is specified. So i just added a -t 'path/to/save/file.pot' and it worked.

shirazz avatar Feb 01 '20 19:02 shirazz

So checking for --pot and depending on it set the correct extension should do the trick

jamuhl avatar Feb 02 '20 08:02 jamuhl