Package eu.webtoolkit.jwt
Class WStdLocalizedStrings
java.lang.Object
eu.webtoolkit.jwt.WLocalizedStrings
eu.webtoolkit.jwt.WStdLocalizedStrings
A localized strings implementation that uses
ResourceBundle
resource bundles.
This localized strings class will translate localized WString
strings in the WApplication.getLocale()
based on their WString.getKey()
.
When a key cannot be found (not in the locale specific or default bundle), the translated string will be "??key??".
Unlike WXmlLocalizedStrings, this implementation does not handle plurals (WString#trn())
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether this contains only valid XML.resolveKey
(Locale locale, String key) Resolves a key in the given locale.void
setContainsXML
(boolean containsXML) Sets whether this resource bundle contains only valid XML.void
Set the bundle name.Methods inherited from class eu.webtoolkit.jwt.WLocalizedStrings
evaluatePluralExpression, hibernate, resolvePluralKey
-
Constructor Details
-
WStdLocalizedStrings
public WStdLocalizedStrings()Constructor.
-
-
Method Details
-
use
Set the bundle name. The argument will be passed toResourceBundle.getBundle(String)
.- Parameters:
bundleName
-
-
resolveKey
Description copied from class:WLocalizedStrings
Resolves a key in the given locale.This method is used by
WString
to obtain the UTF-8 value corresponding to a key in the given locale.Returns a successful
LocalizedString
if the key could be resolved.- Specified by:
resolveKey
in classWLocalizedStrings
- See Also:
-
containsXML
public boolean containsXML()Returns whether this contains only valid XML. Values that are being returned will be checked to be valid XML (text). -
setContainsXML
public void setContainsXML(boolean containsXML) Sets whether this resource bundle contains only valid XML.- Parameters:
containsXML
-- See Also:
-