Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion i18n ?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Scott Blum  
View profile  
 More options May 22 2006, 5:33 pm
From: "Scott Blum" <sco...@google.com>
Date: Mon, 22 May 2006 21:33:08 -0000
Local: Mon, May 22 2006 5:33 pm
Subject: Re: i18n ?
Hi Jochen,

Here's a high-level view of how you can do it.  Sorry for the lack of
specifics, but we will eventually have a sample demonstrating this
technique.

What you do is define an abstract class called something like
"Messages", with a bunch of abstract methods returning String, one
method per message you need.  Then you define a bunch of concrete
implementations of the class, like "MessagesEN" which actually return
the text you need for that language in a concrete implementation.
Finally, you use deferred binding to return the correct concrete
subclass for the particular language you need.  This involves using
GWT.create() at the point where you instantiate the Messages class, and
also setting up a bunch of "replace-with/when-type-assignable" rules in
your module to tell the compiler how to pick the right class.
Unfortunately, this process isn't well documented yet, so you'll have
to just look at what we're doing in UserAgent.gwt.xml and DOM.gwt.xml
and follow it.  Except you'll need to get the browser's preferred
language instead of its User Agent.

This should be a lot easier when we have a good sample.  We're also
looking at ways to do all this automatically from properties files.

Scott Blum
GWT Engineer


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google