This is an interesting issue. Can you try clearing your browser's cache and trying again? You may also try saving the following code into a new gadget file and seeing whether it works. Please report back after you have cleared your cache and tested the following gadget.
<?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="Prefs Test"> <Require feature="opensocial-0.7"/> </ModulePrefs> <Content type="html"> <![CDATA[ <script type="application/javascript"> function test() { var prefs = new gadgets.Prefs(); alert(prefs.getLang()); } </script> <button onclick="test()">Alert language</button> ]]> </Content> </Module> - Jason On May 5, 6:18 pm, Luke <[EMAIL PROTECTED]> wrote: > I am trying to get the orkut localization example to > work,http://code.google.com/p/opensocial-resources/wiki/OrkutLocalization. > I am running into a problem with the gadgets.Prefs() section, it > appears that the line var prefs = new gadgets.Prefs(); simply returns > a reference to gadgets. Then I get an error when calling the getLang > function, "prefs.getLang is not a function". If I call directly to > gadgets.Prefs.prototype.getLang(), it works, so the function itself > exists. Here is the function I am using: > > function getLocale() { > var locale = "en_US"; > if(globalMinorVersionNumber <= 6) { > //TODO: > } else { > if(gadgets != null && gadgets.Prefs() != null) { > var prefs = new gadgets.Prefs(); > if(prefs != null) { > locale= prefs.getLang(); > locale = locale.replace("-","_"); > } > } > } > return locale; > } --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Orkut Developer Forum" group. To post to this group, send email to opensocial-orkut@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/opensocial-orkut?hl=en -~----------~----~----~----~------~----~------~--~---