[zanata-users] zh_Hans_CN zh_CN, zanata.xml, etc

Sean Flanigan sflaniga at redhat.com
Tue May 22 00:07:54 UTC 2012


On 05/22/2012 02:33 AM, Adrian Likins wrote:
> 
> Trying to track down some weirdness we are seeing with the
> translation process for subscription-manager
> (https://translate.zanata.org/zanata/project/view/subscription-manager)
> 
> and in particular the 0.99.x branch.
> 
> Long story short, we noticed the pt_BR translations we had
> were ancient, despite pulling from zanata for every
> release. Eventually we figure out the zanata.xml
> got when we set up the branch is no longer the current
> one.  ie, we had one like:
> 
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <config xmlns="http://zanata.org/namespace/config/">
> <url>https://translate.zanata.org/zanata/</url>
> <project>subscription-manager</project>
> <project-version>0.99.X</project-version>
> <locales>
> <locale>as</locale>
> <locale map-from="bn">bn-IN</locale>
> <locale map-from="de">de-DE</locale>
> <locale map-from="es">es-ES</locale>
> <locale>fr</locale>
> <locale>gu</locale>
> <locale>hi</locale>
> <locale>it</locale>
> <locale>ja</locale>
> <locale>kn</locale>
> <locale>ko</locale>
> <locale>ml</locale>
> <locale>mr</locale>
> <locale>or</locale>
> <locale>pa</locale>
> <locale map-from="pt">pt-BR</locale>
> <locale>ru</locale>
> <locale map-from="ta">ta-IN</locale>
> <locale>te</locale>
> <locale map-from="zh_CN">zh-Hans-CN</locale>
> <locale map-from="zh_TW">zh-Hant-TW</locale>
> </locales>
> </config>
> 
> The latest one from 
> https://translate.zanata.org/zanata/project/view/subscription-manager/iter/0.99.X/config
> is different. Amongst other things, it get's weird of the weird pt-BR 
> entry above, and now
> just includes a pt_BR (which is nice and 100%), and a pt_PT which is not 
> as much (which
> is fine, since it's not a supported lang).
> 
> So updating the zanata.xml, and doing a zanata pull fixes the pt_BR issues.
> 
> Question 1: how often do the zanata.xml's change, and what's the best 
> way to insure
> I have the latest one?

Zanata will generate zanata.xml whenever you click that button.  You can
ignore it if you like, it's just there to help with creating zanata.xml
initially.  But basically, the contents will change when the chosen
locales on the server change.  NB: The zanata.xml generated by Zanata
never includes any map-from attributes, like <locale
map-from="pt">pt-BR</locale>.  I don't know where that came from, you'd
have to look at your source control history.

If someone changes the locales associated with the project, they should
update zanata.xml (probably by hand) and commit it to source control if
they want to push/pull those locales.


> But... doing that changes the list of po's included, included the zh_* 
> langs.

Included in what?

> Question 2: Our supported languages include zh_CN and zh_TW, and this is how
> we have tested (LANG=zh_CN.UTF8, etc). The latest zanata.xml and zanata tool
> however creates zh_Hans_CN.po and zh_Hant_TW.po. Installing these
> breaks LANG=zh_CN.UTF8. LANG=zh_Hans_CN.UTF8 also breaks 
> subscription-manager
> client code in a way that suggest it's not setting the text encoding 
> correctly for
> that case.

You need to restore the map-from attributes for those locales, ie

<locale map-from="zh_CN">zh-Hans-CN</locale>
<locale map-from="zh_TW">zh-Hant-TW</locale>


This will cause zh-Hans-CN to be pulled down to zh_CN.po instead of
zh_Hans_CN.po.


> 
> Should I be installing these different? What is the relation between 
> zh_CN and zh_Hans_CN?

Obviously they really represent the same thing, but zh_Hans_CN includes
information about the use of the Chinese simplified script.  zh_Hans is
often better though, because it lets you use Chinese simplified script
anywhere (eg Malaysia, Singapore), without having to tell the OS that
you live in China.

Unfortunately, locales like zh_Hans and zh_Hans_CN aren't well supported
by runtime i18n libraries.

> 
> (quick answer would be greatly appreciated, since we are close to freeze)
> 
> 
> Adrian
> 


-- 
Sean Flanigan

Senior Software Engineer
Engineering - Internationalisation
Red Hat

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/zanata-users/attachments/20120522/710909bf/attachment.sig>


More information about the zanata-users mailing list