Hi,
After fighting a little with the GWT internacionalization I wanted to set the language automatically, avoiding the user the need of selecting it. I only have three cultures: en (default), es and fr. If the user comes from es or fr a script will change the <meta name=”gwt:property” content=”locale=en”> tag.
I have done it with js:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script type="text/javascript"> var lan="en"; if(!jQuery.browser.msie) { lan=window.navigator.language.split('-')[0]; } else { lan=window.navigator.userLanguage.split('-')[0]; } if(lan == "fr"||lan == "es") $("meta[name='gwt:property']").attr("content", "locale="+lan); </script>
This is executed BEFORE the gwt javascript.
Regards.