2
votes

I have tried to understand how to manage and translate Orchard PO files as described in: http://weblogs.asp.net/bleroy/archive/2011/01/13/creating-and-maintaining-orchard-translations.aspx

The problem started when I have tried to use some Editors that I found in internet and I noticed that:

  • orchard translation files produced by Vandelay.TranslationManager may be invalid
  • edited files in external editor may broke PO translated files and prevent to use sync (valid keys are marked as obsolete and new one are added as untranslated)

First things first I tried to get a reliable explanation of PO file format, and I found here: http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html

Summary of specs:

  • A message in the PO file is uniquely identified by its msgid string
  • When same msgid is used in different files an optional context can be used to distinguish between same msgid

After digging a bit in Vandelay.TranslationManager and all translated files I think I have found the problem.

Vandelay.TranslationManager assumes as unique Key a combination of two values: - #| msgid (used as translation key) - msgctxt (the optional context, that in Orchard is always defined)

The problem is that Vandelay.TranslationManager uses as unique key "#| msgid" instead of "msgid" "#| msgid" is used in fuzzy strings and states previous untranslated string, in orchard is used as an extra information that seems more a "#. "

example of extracted PO file:

#: ~/Modules/nwazet.commerce/Module.txt
#| msgid "Nwazet.Commerce.Category"
msgctxt ~/Modules/nwazet.commerce/Module.txt
msgid "Commerce"
msgstr "Commerce"

#: ~/Modules/nwazet.commerce/Module.txt
#| msgid "Nwazet.Bundles.Category"
msgctxt ~/Modules/nwazet.commerce/Module.txt
msgid "Commerce"
msgstr "Commerce"

note that even if the "#| msgid" are different the two entries above are indeed duplicates according specifications.

Now the question: Is that just a bug or a precise design? Afaik Vandelay.TranslationManager is the recommended way to deal with Po files in Orchard. Any other have problems in using this feature? Thanks

1
Why downvote? Can you explain please?manudea

1 Answers

0
votes

The recommended way to deal with Orchard po files is the online translation tool: http://orchardproject.net/localize