public class I18nLanguage extends Object
translate(String)| Modifier and Type | Field and Description |
|---|---|
protected Locale |
locale
la locale de la langue
|
protected boolean |
missingKeyReturnNull
Used to know null should be returned when a key is not found.
|
protected String |
recordFilePath
Indique le chemin du fichier dans lequel ecrire les entrees non trouvees
|
protected Properties |
resource
toutes les traductions pour cette langue
|
| Constructor and Description |
|---|
I18nLanguage(Locale l) |
I18nLanguage(Locale l,
boolean missingKeyReturnNull) |
I18nLanguage(Locale locale,
String recordFilePath) |
I18nLanguage(Locale locale,
String recordFilePath,
boolean missingKeyReturnNull) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
equals(Object o) |
protected void |
finalize() |
Locale |
getLocale() |
int |
hashCode() |
boolean |
hasRecord(String sentence) |
void |
load(I18nBundleEntry[] bundleEntries)
Deprecated.
since 2.4 use
load(I18nBundleEntry[], Charset) instead,
charset must be provided to avoid encoding problems |
void |
load(I18nBundleEntry[] bundleEntries,
Charset encoding)
charge les traductions de la languea partir d'une liste donnee de
fichiers de traduction.
|
protected void |
recordNotFound(String key) |
int |
size() |
String |
toString() |
String |
translate(String sentence)
Translate takes a sentence and returns its translation if found, the very
same string otherwise.
|
String |
untranslate(String sentence)
Untranslate takes a translated sentence and returns the original one if
found, the very same string otherwise.
|
protected Properties resource
protected final Locale locale
protected String recordFilePath
protected boolean missingKeyReturnNull
public I18nLanguage(Locale l)
public I18nLanguage(Locale l, boolean missingKeyReturnNull)
@Deprecated public void load(I18nBundleEntry[] bundleEntries)
load(I18nBundleEntry[], Charset) instead,
charset must be provided to avoid encoding problemsbundleEntries - the used bundles entries to loadpublic void load(I18nBundleEntry[] bundleEntries, Charset encoding)
bundleEntries - the used bundles entries to loadencoding - Charset to use for Properties loadingpublic String translate(String sentence)
sentence - sentence to translateprotected void recordNotFound(String key)
public String untranslate(String sentence)
sentence - sentence to untranslatepublic Locale getLocale()
public int size()
public void close()
public boolean hasRecord(String sentence)
protected void finalize()
throws Throwable
Copyright © 2004–2017 CodeLutin. All rights reserved.