#2257: .po files : same msgid records could be "deduplicated"
-------------------------+--------------------------------------------------
 Reporter:  rejoc        |        Owner:  rejoc   
     Type:  enhancement  |       Status:  new     
 Priority:  normal       |    Milestone:  1.1b4   
Component:  I18n         |      Version:  1.1 HEAD
 Severity:  normal       |   Resolution:          
 Keywords:  i18n         |  
-------------------------+--------------------------------------------------
Comment (by rejoc):

 Well... I could have choose any msgid that gets duplicated...

 Within a simple .po file, a single msgid, even if it is duplicated, will
 be translated by a single msgstr (seems to be the last non empty msgstr).

 As you say, the translation of a same message can be translated
 differently and if you don't pay attention, you won't see that the message
 you are currently translating is used somewhere else in the same .po file,
 but with another meaning (very likely to append as your .pot file grows).
 Here, the context is the .po file and there is only one translation.

 So having the msgids deduplicated (while keeping a trace of its different
 locations) looked like a good way to detect/avoid bad translations.

 And it does not break anything in the logic of collect/add|merge/compile
 process


 But there is another issue (bug?) :

 if you have a .po file containing
 {{{
 #: demo/templates/master.html:75
 msgid "some text"
 msgstr "un petit texte"

 #: demo/templates/welcome.html:25
 msgid "some text"
 msgstr ""
 }}}

 it compiles and gives the expected translation of "un petit texte" for all
 the occurrences of "some text".

 Now you do a "tg-admin i18n merge" (usually after a collect because you
 modified something) and... you get :
 {{{
 #: demo/templates/master.html:75
 msgid "some text"
 msgstr ""

 #: demo/templates/welcome.html:25
 msgid "some text"
 msgstr ""
 }}}

 You lost your translation because merge uses the last msgstr it finds in
 the .po for a given msgid.

 (I have included a patch for that one... It keeps that last non empty
 message like compile does)

-- 
Ticket URL: <http://trac.turbogears.org/ticket/2257#comment:2>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "TurboGears Tickets" group.
This group is read-only. No posting by normal members allowed.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears-tickets?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to