Package org.gwtproject.i18n.shared
Interface Localizable
- All Known Subinterfaces:
Constants,ConstantsWithLookup,LocalizableResource,Messages
@I18nLocaleSuffuxes({"default","en","es","fr","de"}) public interface Localizable
A tag interface that serves as the root of a family of types used in static internationalization.
Using
where in the table above
GWT.create(class) to instantiate a type that directly extends or
implements Localizable invites locale-sensitive type substitution.
Locale-sensitive Type Substitution
If a typeType directly extends or implements Localizable (as opposed
to Constants or Messages)
and the following code is used to create an object from Type as follows:
Type localized = (Type)GWT.create(Type.class);then
localized will be assigned an instance of a localized subclass, selected based
on the value of the locale client property. The choice of subclass is determined by
the following naming pattern:
If locale is... |
The substitute class for Type is... |
|---|---|
| unspecified | Type itself, or Type_ if Type
is an interface |
x |
Class Type_x if it exists, otherwise treated as if
locale were unspecified |
x_Y |
Class Type_x_Y if it exists, otherwise treated as if
locale were x |
x is a ISO language code and Y
is a two-letter ISO country code.
Specifying Locale
The locale of a module is specified using thelocale client 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 locale client property using a meta tag in the host HTML, use
gwt:property as follows:
<meta name="gwt:property" content="locale.new=x_Y">For example, the following host HTML page sets the locale to "ja_JP":
To specify the locale client property using a query string, specify a value for
the name locale. 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
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceLocalizable.I18nLocaleSuffuxesstatic interfaceLocalizable.IsLocalizable