Is it possible to combine two .po translation files together?

爱⌒轻易说出口 提交于 2020-03-17 05:38:26

问题


We have two .po files, each from different branches of a piece of software.

We need to combine these into a single .po file.

There are duplicates between the two files, and the ideal handling would be for one file's strings to be favoured (consistently).

We have a SUSE system so the --output-file doesn't seem to have the behaviour of ignoring/merging duplicates which the Sun version has according to a man page I found from a web search. (We do not have a Sun machine handy!)


回答1:


What you are looking for is the msgcat util, it concatenates and merges the specified PO dictionaries.

This is part of gettext utils, for more information please consult gettext manual page on msgcat.




回答2:


you can use poedit. To merge your current po-file, you must to open it and click:

  • Catalog > Update from POT-file.
  • Set the filter to all files and select your second.po file

Poedit will show you new & obsolete strings




回答3:


I use msgmerge:

msgmerge [old_file.po] [new_file.po] > output.po

It works for me, but be aware that it does a silly merge, it is, it discards the entries in the old_file (new file overwrites old one).



来源:https://stackoverflow.com/questions/1561897/is-it-possible-to-combine-two-po-translation-files-together

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!