levik
levik

Reputation: 117559

Localization in OpenSocial gadget app

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"/>
  </ModulePrefs>
  . . .
</Module>

But how do I actually extract values from them?

Upvotes: 2

Views: 590

Answers (1)

Alejandro Bologna
Alejandro Bologna

Reputation: 823

To extract the values you should use the getMsg method

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

Upvotes: 5

Related Questions