I am working on a Wordpress plugin and noticed that the main PHP file - let's just call it blah.php
- contains calls such as:
100: <?php _e('Foo', 'blah'); ?>
101: <?php _e('Bar', 'blah'); ?>
...
It is accompanied by a blah.pot
file in languages subfolder, with code such as:
#: blah.php:100
msgid "Foo"
msgstr ""
#: blah.php:101
msgid "Bar"
msgstr ""
Suppose I want to add a new piece of text, in between the above two pieces, in the PHP:
100: <?php _e('Foo', 'blah'); ?>
101: <?php _e('Baz', 'blah'); ?> <!-- New -->
102: <?php _e('Bar', 'blah'); ?>
...
Wouldn't this mean that I would have to re-number blah.pot
, like so?
#: blah.php:100
msgid "Foo"
msgstr ""
#: blah.php:101
- msgid "Bar"
+ msgid "Baz"
msgstr ""
+ #: blah.php:102
+ msgid "Bar"
+ msgid "Bar"
+ msgstr ""
What if there are hundreds of such items? Won't this be time-consuming?
Is there a faster way to, say, automatically generate the pot file from the PHP, with correct line numbers?