public interface Localizer
Modifier and Type | Method and Description |
---|---|
String |
localize(HumanReadableText text,
Locales locales)
Localizes the given text for display.
|
String localize(HumanReadableText text, Locales locales)
Localizes the given text for display.
It is recommended that HumanReadableText.getKey()
is used as key.
HumanReadableText.getParameters()
may (optionally) be used for
substitution into a parameterised text.
Implementators are free to use any appropriate algorithm to determine
which locale should be used. A client application may request a
particular Locale based on it's local settings. This preference SHOULD be
made available (by the caller) through
Locales.getClientPreference()
. In addition, user data may contain
localization preferences. These SHOULD be made available (by the caller)
through Locales.getUserPreferences()
.
HumanReadableText.getDefaultValue()
provides a simple, standard
english phrase. It is recommended that implementors use this value when a
suitable localisation cannot be discovered.
text
- describes the text requiring localisation, not nulllocales
- describes preferences, not nullCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.