views:

284

answers:

1

I'm trying to add multi-language support to an OpenSocial application. I see that I can link to my own message bundles in the gadget XML markup:

<Module>
  <ModulePrefs title="Hello" description="Message bundle demo">
     <Require feature="opensocial-0.7"/>
     <Locale lang="en" messages="http://example.com/hello/en_ALL.xml"/&gt;
  </ModulePrefs>
  . . .
</Module>

But how do I actually extract values from them?

+4  A: 

To extract the values you should use the getMsg method

var prefs = new gadgets.Prefs();
var msg = prefs.getMsg('hello_world');
Alejandro Bologna