Package com.google.gwt.i18n.shared
Interface Localizable
-
- All Known Subinterfaces:
CellTree.CellTreeMessages,Constants,ConstantsWithLookup,CurrencyCodeMapConstants,DateTimeConstantsImpl,Localizable,LocalizableResource,Messages,NumberConstantsImpl,SimplePager.ImageButtonsConstants,TimeZoneConstants
public interface LocalizableA tag interface that serves as the root of a family of types used in static internationalization. UsingGWT.create(class)to instantiate a type that directly extends or implementsLocalizableinvites locale-sensitive type substitution.Locale-sensitive Type Substitution
If a typeTypedirectly extends or implementsLocalizable(as opposed toConstantsorMessages) and the following code is used to create an object fromTypeas follows:Type localized = (Type)GWT.create(Type.class);
thenlocalizedwill be assigned an instance of a localized subclass, selected based on the value of thelocaleclient property. The choice of subclass is determined by the following naming pattern:
where in the table aboveIf localeis...The substitute class for Typeis...unspecified Typeitself, orType_ifTypeis an interfacexClass Type_xif it exists, otherwise treated as iflocalewere unspecifiedx_YClass Type_x_Yif it exists, otherwise treated as iflocalewerexxis a ISO language code andYis a two-letter ISO country code.Specifying Locale
The locale of a module is specified using thelocaleclient property, which can be specified using either a meta tag or as part of the query string in the host page's URL. If both are specified, the query string takes precedence.To specify the
localeclient property using a meta tag in the host HTML, usegwt:propertyas follows:<meta name="gwt:property" content="locale=x_Y">
For example, the following host HTML page sets the locale to "ja_JP":<html> <head> <meta name="gwt:module" content="com.google.gwt.examples.i18n.ColorNameLookupExample"> <meta name="gwt:property" content="locale=ja_JP"> </head> <body> <script src="gwt.js"></script> </body> </html>To specify the
localeclient property using a query string, specify a value for the namelocale. For example,http://www.example.org/myapp.html?locale=fr_CA
For More Information
See the GWT Developer Guide for an introduction to internationalization.- See Also:
Constants,ConstantsWithLookup,Messages,Dictionary