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"                                               
             <rjbax...@us.ibm.                                             
             com>                                                       To 
                                       dev@shindig.apache.org              
             2011-11-18 07:11                                           cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: gadget i18n questions           
             dev@shindig.apach                                             
                   e.org                                                   
                                                                           
                                                                           
                                                                           
                                                                           




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)


Reply via email to