public class DefaultLocalizer extends Object implements Localizer
HumanReadableText.getDefaultValue()
. This implementation is
independent of user, client and system locale.Constructor and Description |
---|
DefaultLocalizer() |
public String localize(HumanReadableText text, Locales locales)
Localizer
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.
localize
in interface Localizer
text
- describes the text requiring localisation, not nulllocales
- describes preferences, not nullLocalizer.localize(HumanReadableText, Locales)
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.