Class WXmlLocalizedStrings
WLocalizedStrings implementation which uses an XML file as input resource.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolveKey(Locale locale, String key) Resolves a key in the given locale.resolvePluralKey(Locale locale, String key, long amount) Resolves the plural form of a key in the given locale.voidUse an XML file as input resource.voiduseBuiltin(String bundle) Methods inherited from class eu.webtoolkit.jwt.WLocalizedStrings
evaluatePluralExpression, hibernate
-
Constructor Details
-
WXmlLocalizedStrings
public WXmlLocalizedStrings()Constructor.
-
-
Method Details
-
use
Use an XML file as input resource.When resolving a key (
resolveKey(java.util.Locale,java.lang.String), orresolvePluralKey(java.util.Locale,java.lang.String,long)), the added bundles will be checked in reverse order. The last added bundle, will be checked first. This way the keys can be "overridden".- Parameters:
bundleName-
-
resolveKey
Resolves a key in the given locale.This method is used by
WStringto obtain the UTF-8 value corresponding to a key in the given locale.Returns a successful
LocalizedStringif the key could be resolved.The order in which the bundles are iterated is the reverse order in which they are added. If a bundle that is added after a first bundle also specifies the same key, the value of the latest added bundle is retrieved.
- Specified by:
resolveKeyin classWLocalizedStrings- See Also:
-
resolvePluralKey
Resolves the plural form of a key in the given locale.This method is used by
WStringto obtain the UTF-8 value corresponding to a key in the current locale, taking into account the possibility of multiple plural forms, and chosing the right plural form based on theamountpassed.Throws a std::logic_error if the underlying implementation does not provide support for plural internationalized strings.
Returns a successful
LocalizedStringif the key could be resolved.The order in which the bundles are iterated is the reverse order in which they are added. If a bundle that is added after a first bundle also specifies the same key, the value of the latest added bundle is retrieved.
- Overrides:
resolvePluralKeyin classWLocalizedStrings
-
useBuiltin
-