Question

I have a .po file that works with the theme and it contains 1259 characters, and i translated many words in it.

That been said, after the theme was updated i found out that the new .po files contains 1898 (460 more characters).

So i would like to know if there is a safe and efficient way to merge these two files, that means keeping the integrity of manual translations i did + the new terms that were added by new version of the theme file.

Can anyone tell me if there is a way to achieve this ? I'd appreciate it

Thank you in advance

Was it helpful?

Solution

Since .po files are full text, you could first compare the files to see if the differences between the files occur at a specific place (is the addition only located at the end?), are the same keys used for different values?, ... to ensure that no data is being lost.

To that purpose you could use: - CLI tools such as diff or a program like Meld (which is based on diff) to get a visual aid when comparing the files. - an IDE which provides file comparison possibilities (For example Atom with the add-on compare-files)

You could try to merge the files together automatically by using the following CLI tool msgmerge.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top