start
Table of Contents

--duplicates=DUPLICATESTYLE

Gettext PO files only allow one message with a common msgid. Many other formats have duplicate entries. To create a valid PO file you need to merge these duplicate entries into one PO message. However, this often negatively affects the roundrip or is not what is expected by the user. Thus we have a number of methods of handling duplicates which we call duplciate styles.

merge

This is the traditional Gettext approach. All messages with the same source string or English string are merged into one PO message.

#: file1.dtd:instruction_manual
#: file1.dtd:manual_process
msgid "Manual"
msgstr ""

If however the source text is blank (these are often configuration options in Mozilla) then the merge style will use KDE comments as used in the msgid_comment style in order to create unambiquous entries that can still be used for configuration.

#: file1.dtd:translators_name
msgid "_: file1.dtd:translators_name\n"
msgstr ""

#: file1.dtd:translators_email
msgid "_: file1.dtd:translators_email\n"
msgstr ""

keep

Duplictes are not merged and each appear in their own message. This type of PO file will not work with the Gettext tools.

#: file1.dtd:instruction_manual
msgid "Manual"
msgstr ""

#: file1.dtd:manual_process
msgid "Manual"
msgstr ""

msgid_comment

If a duplicates is discovered then we make use of the KDE style comments to make them unique.

#: file1.dtd:instruction_manual
msgid "_: instruction_manual\n"
"Manual"
msgstr ""

#: file1.dtd:manual_process
msgid "_: manual_process\n"
"Manual"
msgstr ""

You can see that both the entries instruction_manual and manual_process have source strings of “Manual”. By adding the KDE style comment we make the messages unique. This is helful for many people but isn’t quite perfect in that in many cases your language will use the same word and you don’t want it split - you now simply have more work.

msgid_comment_all

This operates the same as msgid_comment except now every message has a KDE style comment added regardless if it is a duplicate or not.