ariba.util.i18n
Interface LocalizedStringInterface
- All Known Implementing Classes:
- LocalizedJavaString
public interface LocalizedStringInterface
This is an extremely powerful concept, a universal source of multi-locale string data.
There are several instances already of anonymous implementations of this interface,
which are then used with LocaleUtil.getPopulatedMLS to create MultiLocaleStrings with
a localized value in each of the realm's locales, using refactored code that
previously just provided a value in a single locale. It should be implemented by
LocalizedJavaString, MultiLocaleStringSource, MultiLocaleString, and
MultiLingualString.
Method Summary |
java.util.Locale |
getSourceOfTruthLocale()
|
java.lang.String |
getString(java.util.Locale locale)
Implementations of the single parameter getString should always just call
getString with a second parameter of true, for useDefaulting. |
java.lang.String |
getString(java.util.Locale locale,
boolean useDefaulting)
|
getString
java.lang.String getString(java.util.Locale locale)
- Implementations of the single parameter getString should always just call
getString with a second parameter of true, for useDefaulting.
getString
java.lang.String getString(java.util.Locale locale,
boolean useDefaulting)
- Returns:
- String value in given locale for localized/multiLocale/multiLingual
string. If translation in that locale is not available, then if useDefaulting is
true, it will return a non-null value, with an ultimate default to "", if no other
default is available. If no translation in that locale is available and
useDefaulting is false, it will simply return null.
getSourceOfTruthLocale
java.util.Locale getSourceOfTruthLocale()
- Returns:
- Locale which is the "source of truth" for this
localized/multiLocale/multiLingual string. This has also been known as the
"OriginalLocale", and as the BaseLocale. It is the source of truth for
translating this string into other locales. For a LocalizedJavaString, this will
default to returning Locale.US, since the source of truth is the originalString in
the Java code, which is often in American English. For a MultiLocaleString it is
the OriginalLocale, and for a MultiLingualString it is probably the default locale
of the realm/partition.
AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.