Localization
To localize your application you can use message bundles that are defined in the OpenSocial spec. Hyves only uses the Dutch and the English language, so in the example the English message bundle is the default one and the Dutch message bundle is used when the Dutch language is selected. For these 2 message bundles you need to specify two files. More information on localization can be found here.
Example of the use of 2 message bundles:
<?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="Message bundle" summary="__MSG_SUMMARY__" description="__MSG_DESCRIPTION__" height="350" author="" author_email="" screenshot="" thumbnail=""> <Require feature="opensocial-0.7"/> <Locale messages="http://www.apikooien.nl/examples/opensocial/message_bundle/locale/ALL_ALL.xml"/> <Locale lang="nl" messages="http://www.apikooien.nl/examples/opensocial/message_bundle/locale/nl_ALL.xml"/> </ModulePrefs> <Content type="html"> <![CDATA[ <script type="text/javascript"> function init() { var sText = "__MSG_TEST_TEXT_LANGUAGE_TEMPLATE__"; document.getElementById('content').innerHTML = sText; } gadgets.util.registerOnLoadHandler(init); </script> <div id="content"></div> ]]> </Content> </Module>
Dutch message bundle:
<?xml version="1.0" encoding="UTF-8" ?> <messagebundle> <msg name="SUMMARY">Samenvatting</msg> <msg name="DESCRIPTION">Beschrijving</msg> <msg name="TEST_TEXT_LANGUAGE_TEMPLATE">Deze tekst is in het Nederlands geschreven, dit template bestand wordt gebruikt als de Nederlands taalinstelling is geslecteerd op Hyves.</msg> </messagebundle>
The default (English) message bundle:
<?xml version="1.0" encoding="UTF-8" ?> <messagebundle> <msg name="SUMMARY">Summary</msg> <msg name="DESCRIPTION">Description</msg> <msg name="TEST_TEXT_LANGUAGE_TEMPLATE">This text is writen in English, this is the default file that is used if no message template is found.</msg> </messagebundle>