Updating WordPress Theme/Plugin POT file without losing line numbers consistency

This is a recurrent problem I have when building WordPress Theme or Plugin: each new feature added to the code breaks the i18n files consistency. POT/PO files store the line number of the translated string, so if I add a new ten-lines block of code to my Theme’s functions file for instance, all translated strings’ line numbers from this point will be wrong.

Currently I’m stuck with generating a new POT file with makepot and using a diff tool to update all line numbers accordingly. This is a waste of time especially when dealing with large translation files and/or multiple POT files… Did anyone ever came up with a clever way to update language files line numbers without crippling the already translated texts?

Read More

Thanks!

Related posts

1 comment

  1. use poedit, and build a translation database with it.

    Even without poedit you can probably parse an old po file to read all the translation and replace the matching string in the new file.

Comments are closed.