Search code examples
cakephpinternationalizationpoeditpocakephp-2.x

How to update an existing .po file with a newly generated .pot file?


Cake version is 2.x. I have extracted all the texts inside __ function with ./Console/cake i18n extract command, moved the default.pot file into app/Locale/[iso3]/LC_MESSAGES/default.po and translated it to corresponding language. Everything is working fine.

After some time I have added some new functionality into the site and I need to add those messages into the po file. However if I use the same command it will create a new pot and I have to either manually merge them or replace with new po file and copy/paste the translations - both are too much manual work, because I have a few thousand lines of text.

Is there any way to tell cake update my po file adding only messages that does not exist in there ?

Thanks


Solution

  • Download PoEdit. It has an option to update your PO file from an existing pot file. From the menu go to Catalog -> Update from POT file.

    So you will create your a new POT file and then update your PO file. PoEdit will update the PO file with the new values and I think it also removes any unnecessary ones.

    PS: It would be wise before making any move to keep a backup.