2

I want to remove source references comment from .po file that is generated using poeditor.

Exa.

#: controllers/admin/device.php:282
msgid "Error while deleting !!"
msgstr "Error while deleting !!"

I want to remove this #: comments from .po file

jay.jivani
  • 1,560
  • 1
  • 16
  • 33

2 Answers2

3

I got an answer:

https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html

Check this link and i need to use xgettext with --no-location attribute

If you want it in Windows then refer this link:

https://docs.djangoproject.com/en/1.7/topics/i18n/translation/#gettext-on-windows

And then using CMD and using this command you can acheive this:

xgettext --no-location -o /output-file-path /input-file-path
jay.jivani
  • 1,560
  • 1
  • 16
  • 33
1

The following command does not require installing xgettext utility, rather it relies on sed utility that is pre-installed on UNIX-based systems:

sed -i '/#:.*$/d' *.po

On Windows this command can be executed through bash emulators like Git Bash

zeko868
  • 163
  • 1
  • 3
  • 10