最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

translation - Updating WordPress ThemePlugin POT file without losing line numbers consistency

programmeradmin0浏览0评论

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?

Thanks!

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?

Thanks!

Share Improve this question asked Feb 11, 2014 at 9:44 caercamcaercam 1062 silver badges7 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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.

发布评论

评论列表(0)

  1. 暂无评论