No announcement yet.
  • Filter
  • Time
Clear All
new posts

    Getting Client location

    Be sure your post includes:

    1. the SmartGWT or SmartClient version and browser version(s) involved;


    2. for a server-side problem, the complete logs generated during processing of the request;

    3. for a client-side problem, the contents of the Developer Console (see FAQ for usage);

    I am a application that will be distributed worldwide. I need to be able to figure out the location of this client in order to handle specific request. Does SmartGWT have something in the work for this?

    4. if there is a JavaScript error, the stack trace logged in the Developer Console (from Internet Explorer if possible); and

    5. sample code.

    Posts with incomplete information are much more likely to be ignored.

    Hello TTran,

    This is covered in the core GWT documentation on i18n. In a nutshell, add tags like these to your .gwt.xml file:

    	<inherits name=""/>
            <!-- one extend-property per locale you want to support -->
    	<extend-property name="locale" values="en"/>
    	<extend-property name="locale" values="de"/>
    This will cause GWT to generate different variants of your application per locale. GWT will automatically choose the locale based on browser detection, or you can control it specifically with by passing a "local=de" URL parameter or with a meta tag like this in your .html file:

    <meta name="gwt:property" content="locale=de" >
    Localized messages for core framework constants (like "Contacting server...") will automatically be used - see com/smartgwt/client/i18n within smartgwt.jar for a list of included locales.

    For application-specific messages, you create a class extending from Messages and provide a .properties file per locale - more information is in the GWT documentation on i18n.