i18next-gettext-converter
i18next-gettext-converter copied to clipboard
generate pot file from cli
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
does only pot not work or in general?
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'));
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
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.
So checking for --pot
and depending on it set the correct extension should do the trick