public class Translator extends Object
| Constructor and Description |
|---|
Translator() |
| Modifier and Type | Method and Description |
|---|---|
static String |
translate(Locale srcLang,
Locale destLang,
String words) |
static Map |
translateBundle(String name,
Set<String> keySet,
Locale srcLang,
Locale destLang)
translates all property values from srcLang to destLang.
|
static Properties |
translateProperties(String name,
Map origin,
Locale srcLang,
Locale destLang)
translates all property values from srcLang to destLang. splits camel case expressions.
|
static Map |
translatePropertiesFast(String name,
Map origin,
Locale srcLang,
Locale destLang)
tries to translate all properties on one request. if values have more than one word (myEntry=one two), the
mapping will fail
|
public static Properties translateProperties(String name, Map origin, Locale srcLang, Locale destLang)
name - bundle nameorigin - properties to translatesrcLang - source languagedestLang - destination languagepublic static Map translatePropertiesFast(String name, Map origin, Locale srcLang, Locale destLang)
name - bundle nameorigin - properties to translatesrcLang - source languagedestLang - destination languagepublic static Map translateBundle(String name, Set<String> keySet, Locale srcLang, Locale destLang)
ResourceBundle wrapper Messages
to get the values for the given keys. splits camel case expressions. writes the bundle to a file and reloads the
resource bundles.name - bundle namekeySet - key-set of a resource bundle.srcLang - source languagedestLang - destination languageCopyright © 2012–2018. All rights reserved.