I verified the language setting, "cn" is the county, "zh" is the language, for example, zh-cn, zh-tw. I also tried a few other languages, such as en-us, pt-br..., but still can't make it work. So I think it might be some other pieces not functional.
Any other thoughts? Thanks Best Regards Marshall Shi(Shi Wei) "Dan Dumont" <ddum...@us.ibm.c om> To dev@shindig.apache.org 2011-11-28 22:17 cc Subject Please respond to Re: gadget i18n questions dev@shindig.apach e.org did you fix these functions? cfg[osapi.container.ContainerConfig.GET_COUNTRY] = function() {return 'cn';} cfg[osapi.container.ContainerConfig.GET_LANGUAGE] = function() {return 'zh';} You have GET_COUNTRY returning the "language", and GET_LANGUAGE returning the "country" From: Wei CSDL Shi <shiwc...@cn.ibm.com> To: dev@shindig.apache.org, Date: 11/21/2011 10:38 PM Subject: Re: gadget i18n questions I tried with the suggested way in my test gadget: <ModulePrefs title="TestOSGadget" description="This is a test!"> <Locale messages="i18n/ALL-ALL.xml"/> <Locale lang="en" messages="i18n/en-ALL.xml"/> <Locale lang="en" country="us" messages="i18n/en-us.xml"/> <Locale lang="pt" country="BR" messages="i18n/pt-BR.xml"/> </ModulePrefs> The content of i18n/pt-BR.xml: <messagebundle> <msg name="hello_world">pt-br</msg> </messagebundle> Markup in the sample gadget to load the hello_world string: <div> <b>__MSG_hello_world__</b> <h3><span>blabla</span></h3> </div> The gadget always load the message from i18n/ALL-ALL.xml, if I remove i18n/ALL-ALL.xml, then it will show "__MSG_hello_world__" in the UI. Seems the remaining locales other than the default one are not loaded. Do I still miss something to make it work? Thanks Best Regards Marshall Shi(Shi Wei) "Dan Dumont" ---2011-11-18 22:33:37---Also, I think you have your localization functions backwards: "Dan Dumont" <ddum...@us.ibm.com> 2011-11-18 22:30 Please respond to dev@shindig.apache.org To dev@shindig.apache.org cc Subject Re: gadget i18n questions Also, I think you have your localization functions backwards: cfg[osapi.container.ContainerConfig.GET_COUNTRY] = function() {return 'cn';} cfg[osapi.container.ContainerConfig.GET_LANGUAGE] = function() {return 'zh';} The locale is cn-zh, not zh-cn. From: Dan Dumont/Westford/IBM@Lotus To: dev@shindig.apache.org, Date: 11/18/2011 09:26 AM Subject: Re: gadget i18n questions The attributes on your locale look wrong. Here's a sample from one of my localization gadgets: <ModulePrefs title="TestOSGadget" author_email="ddum...@us.ibm.com" description="This is a test!"> <Locale messages="../i18n/ALL-ALL.xml"/> <Locale lang="ar" messages="../i18n/ar-ALL.xml" language_direction="rtl" /> <Locale lang="en" messages="../i18n/en-ALL.xml"/> <Locale lang="en" country="us" messages="../i18n/en-us.xml"/> <Locale lang="de" messages="../i18n/de-ALL.xml"/> <Locale lang="ja" messages="../i18n/ja-ALL.xml"/> <Locale lang="ko" messages="../i18n/ko-ALL.xml"/> <Locale lang="pt" messages="../i18n/pt-ALL.xml"/> <Locale lang="pt" country="br" messages="../i18n/pt-BR.xml"/> <Locale lang="ru" messages="../i18n/ru-ALL.xml"/> You shouldn't have to reference another html file, but note the lang and country attrs From: Wei CSDL Shi <shiwc...@cn.ibm.com> To: dev@shindig.apache.org, Date: 11/17/2011 10:39 PM Subject: Re: gadget i18n questions I tried to set the GET_COUNTRY and GET_LANGUAGE in my container, the metadata request already contains the county and lanague I set, but it still can't show that language when rendering the gadget. Here is how I set them into my container as a testing purpose: cfg[osapi.container.ContainerConfig.GET_COUNTRY] = function() {return 'cn';} cfg[osapi.container.ContainerConfig.GET_LANGUAGE] = function() {return 'zh';} var cc = new osapi.container.Container(cfg); I can't find direct info about how to make it work. Anybody have any experience on this gadget feature? Thanks Best Regards Marshall Shi(Shi Wei) "Ryan J Baxter" ---2011-11-18 07:16:08---I think you probably need to set the GET_COUNTRY and GET_LANGUAGE "Ryan J Baxter" <rjbax...@us.ibm.com> 2011-11-18 07:11 Please respond to dev@shindig.apache.org To dev@shindig.apache.org cc Subject Re: gadget i18n questions I think you probably need to set the GET_COUNTRY and GET_LANGUAGE parameters in the container config so the container knows the country and language preferences, although I have not tried this myself. These parameters get passed in the metadata request which I assume would then return the IFR URL with the correct country and language parameters set. -Ryan Email: rjbax...@us.ibm.com Phone: 978-899-3041 developerWorks Profile From: Wei CSDL Shi <shiwc...@cn.ibm.com> To: shindig <dev@shindig.apache.org>, Date: 11/17/2011 02:42 AM Subject: gadget i18n questions I am trying to use the multi language feature of gadget. Unfortunately I have no luck to make it work when I switch my browser language. Here is my test gadget: <?xml version="1.0" encoding="UTF-8"?> <Module> <ModulePrefs title="SampleGadgetWithScope"> <Require feature="opensocial-i18n"></Require> <Locale lang="all"> <msg name="hello_world">Hello World.</msg> </Locale> <Locale lang="de"> <msg name="hello_world">Hola Mundo.</msg> </Locale> <Locale lang="zh-cn"> <msg name="hello_world">你好世界.</msg> </Locale> </ModulePrefs> <Content type="html"> <![CDATA[ <div id="__MODULE_ID__gadget"> <b>__MSG_hello_world__</b> <h3> <span>blabla</span> </h3> </div> ]]> </Content> </Module> In the common container, I tried to load feature "opensocial-i18n" as well, but the "zh-cn" and "de" message never show up when I switch my browser locale. Can anyone point me out what I am doing wrong here? I searched for a while but I can't find any direct help on this topic. I would propose to add a i18n sample page in shindig build. Thanks Best Regards Marshall Shi(Shi Wei)