|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Translator
A more or less simple "dictionary", which lets one lookup i18n strings.
Implementation could make use of a HashMap
, a ResourceBundle
or whatever seems to be appropriate.
Method Summary | |
---|---|
Locale |
getLocale()
Get the locale currently used for translations. |
void |
setLocale(Locale locale)
Set the locale, which should be use for translations. |
String |
xlate(String prefix,
String name)
Translate the given name wrt. to the given prefix. |
Method Detail |
---|
void setLocale(Locale locale)
locale
- Locale to set. If null
, the default locale
should be used.Locale.getDefault()
Locale getLocale()
null
if not set and default locale is used, the locale
in use otherwise.String xlate(String prefix, String name)
One should never let an exception pass or throw here. Instead catch and log.
prefix
- key prefix. Usually a purpose indicator.name
- key name. Usually an instance ID.
null
).
|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |