I am working on translating an application I am developing. I have strings like:
echo _("Welcome to my site");
I can then use the command line to create a .po
file from all the PHP files in a particular directory by doing:
find . -iname "*.php" | xargs xgettext
However, when I import this into Poedit, I see a box called "Notes for translators". This may be useful sometimes, however I can't figure out how to populate it. What code do I need to add to my PHP file so that xgettext will add notes to translators?
the help of xgettext shows:
-cTAG, --add-comments=TAG place comment blocks starting with TAG and preceding keyword lines in output file -c, --add-comments place all comment blocks preceding keyword lines in output file
so add in your file by example:
// COMMENTTAG: This is another block comment that will be extracted by xgettext.
And run xgettext with --add-comments=COMMENTTAG
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With