My client should specify locale with attribute "language=xx" set in
the query string. I tried pasting updated code from i18n..gwt.xml
module but getting an error "Unexpected exception in locale detection,
using default: TypeError: invalid 'in' operand kd[a]".

        <property-provider name="locale">
    <![CDATA[
      try {
      var locale;

      // Look for the locale as a url argument
      if (locale == null) {
        var args = location.search;
        var startLang = args.indexOf("language");
        if (startLang >= 0) {
          var language = args.substring(startLang);
          var begin = language.indexOf("=") + 1;
          var end = language.indexOf("&");
          if (end == -1) {
            end = language.length;
          }
          locale = language.substring(begin, end);
        }
      }

      if (locale == null) {
        // Look for the locale on the web page
        locale = __gwt_getMetaProperty("language")
      }

      if (locale == null) {
        return "default";
      }

      while (!__gwt_isKnownPropertyValue("language",  locale)) {
        var lastIndex = locale.lastIndexOf("_");
        if (lastIndex == -1) {
              locale = "default";
          break;
        } else {
          locale = locale.substring(0,lastIndex);
        }
      }
      return locale;
    } catch(e){
      alert("Unexpected exception in locale detection, using default:
" + e);
      return "default";
    }
  ]]>
  </property-provider>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to