How to merge translations

Last modified: January 1, 2008 - 07:14

Say you have fr.po, a translation of some module. The module gets updated and some strings change. You now have an updated module.pot which is blank. You now need to merge the changes into your translation, without loosing the strings previously translated.

First, check with your usual PO editor if it has a merge function.

Otherwise, you can try the UNIX CLI tool msgmerge, which comes together with GNU gettext.

Better yet, you can use merge.sh, a bash msgmerge wrapper function by the KDE team. Download the file, and put it in your bin/ folder (somewhere in your $PATH). You will need to have GNU gettext version 0.16 or newer installed on your system. Then do the following command:

merge.sh fr.po module.pot

where fr.po is your old translation, and module.pot, the updated pot for the module. After that, open fr.po with your usual PO editor.

See the msgmerge documentation.

 
 

Drupal is a registered trademark of Dries Buytaert.