how to handle duplicate strings in translation

Asked by blittan

In our language files we have several string using the same meaning. We do not nativly use .po files , but converts our xml based files to be able to make use of your online translation service.

We have

  <string id="766">Reserved</string>
  <string id="767">Reserved</string>
  <string id="768">Reserved</string>
  <string id="769">Reserved</string>

which when converted to .po gives the error duplicate message definition.

Is there someway to workaround this?

Thanks in advance, blittan

Question information

English Edit question
Launchpad itself Edit question
No assignee Edit question
Solved by:
Adi Roiban
Last query:
Last reply:
Revision history for this message
Best Adi Roiban (adiroiban) said :


What converter are you using?

In this case you should use the "context" feature from gettext. You can see an explanation and usage example here:

In this case you should modify your xml to po convert to add context for those strings or you can manualy edit the po file before uploading it to Launchpad.


Revision history for this message
blittan (blittan) said :

Thanks, this solved my issues.

I am using a converter written by myself.

Can use msgctxt "id_number" as a unique string.

Much appriciated.

Revision history for this message
blittan (blittan) said :

Thanks Adi Roiban, that solved my question.