org.nuiton.i18n
Class Language

java.lang.Object
  extended by org.nuiton.i18n.Language

public class Language
extends Object

This class is used by the i18n class. It encapsulates the translation resource for a given language.

Encoding to be used to read properties files will be ISO-8859-1 since java does it like this.


Field Summary
protected  Locale locale
          la locale de la langue
protected  Properties resource
          toutes les traductions pour cette langue
 
Constructor Summary
Language(Locale l)
           
 
Method Summary
 void close()
           
 boolean equals(Object o)
           
protected  void finalize()
           
static URLClassLoader getLoader()
           
 Locale getLocale()
           
 int hashCode()
           
 void load(org.nuiton.i18n.bundle.I18nBundleEntry[] bundleEntries)
          charge les traductions de la languea partir d'une liste donnee de fichiers de traduction.
 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.
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

resource

protected Properties resource
toutes les traductions pour cette langue


locale

protected Locale locale
la locale de la langue

Constructor Detail

Language

public Language(Locale l)
Parameters:
l - the current locale of the language
Method Detail

getLoader

public static URLClassLoader getLoader()

load

public void load(org.nuiton.i18n.bundle.I18nBundleEntry[] bundleEntries)
charge les traductions de la languea partir d'une liste donnee de fichiers de traduction.

Parameters:
bundleEntries - the used bundles entries to load

translate

public String translate(String sentence)
translate takes a sentence and returns its translation if found, the very same string otherwise.

Parameters:
sentence - sentence to translate
Returns:
translated sentence

untranslate

public String untranslate(String sentence)
untranslate takes a translated sentence and returns the original one if found, the very same string otherwise.

Parameters:
sentence - sentence to untranslate
Returns:
untranslated sentence

getLocale

public Locale getLocale()

size

public int size()

close

public void close()

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2009 CodeLutin. All Rights Reserved.