|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sourceforge.worldsaver.util.Localizer
This is a wrapper class that handles several localized language files. To use this, you must have some language files somewhere. If you have a package com.microsoft.stupid you could have a dir called lang there with a language file `deutsch'. Then you would call new Localizer() or setLang() with ("/com/microsoft/stupid/lang/",Locale.GERMAN) to initialize this class.
Constructor Summary | |
Localizer(java.util.Locale loc,
java.lang.String path)
Constructs a new Localizer. |
Method Summary | |
java.lang.String |
get(java.lang.String key)
Returns the localized String mapping the key. |
java.lang.String |
get(java.lang.String key,
java.lang.String param1)
Returns the localized String mapping the key. |
java.lang.String |
get(java.lang.String key,
java.lang.String param1,
java.lang.String param2)
Returns the localized String mapping the key. |
java.lang.String |
get(java.lang.String key,
java.lang.String param1,
java.lang.String param2,
java.lang.String param3)
Returns the localized String mapping the key. |
boolean |
setLang(java.util.Locale loc,
java.lang.String path)
Sets the new language for this Localizer. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Localizer(java.util.Locale loc, java.lang.String path) throws java.io.IOException
loc
- the locale which language should be usedpath
- the path to the new language filejava.io.IOException
- if no language file for loc had been foundMethod Detail |
public boolean setLang(java.util.Locale loc, java.lang.String path)
loc
- the locale which language should be usedpath
- the path to the new language filepublic java.lang.String get(java.lang.String key)
key
- the keypublic java.lang.String get(java.lang.String key, java.lang.String param1)
key
- the keyparam1
- the replacement for xxxpublic java.lang.String get(java.lang.String key, java.lang.String param1, java.lang.String param2)
key
- the keyparam1
- the replacement for xxxparam2
- the replacement for yyypublic java.lang.String get(java.lang.String key, java.lang.String param1, java.lang.String param2, java.lang.String param3)
key
- the keyparam1
- the replacement for xxxparam2
- the replacement for yyyparam3
- the replacement for zzz
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |