Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is the #: (file, line number) line in a wordpress .po file necessary

Wordpress translation calls for a [theme name].po file, in which are your key value mapping for your translations, such as:

#: ../single-con_book_reviews.php:197
msgid "Author: "
msgstr ""

However, putting the file and line number of every occurrence of the word "Author: " is arduous and silly. Is it required? Or can I just use the saner:

msgid "Author: "
msgstr ""

OR, am I just missing something here?

See, the problem with putting the file & line number is it would discourage you from ever writing any new or removing any old code. If you add a line at the beginning of a 1200 line php file you've suddenly ruined all of your translation mappings. Surely these are more of just comments... right?

like image 817
cmcculloh Avatar asked Oct 20 '25 11:10

cmcculloh


1 Answers

Its a comment and its not required. Its there mostly for historical reason, where it were more difficult to find out, where a specific string occurs. Additional this is usually (then and now) added automatically by a parser, that creates the translate-templates right from the source, and not manually by hand.

like image 158
KingCrunch Avatar answered Oct 22 '25 00:10

KingCrunch