be.saltwater.jaqel.i18n
Class Translator

java.lang.Object
  extended bybe.saltwater.jaqel.i18n.Translator

public class Translator
extends java.lang.Object

Translates (an array of) String objects from predefined keywords to a certain language.

Author:
Robin Wittevrongel

Method Summary
static Translator getInstance()
           
 void setLanguage(java.lang.String lcode)
          Set the language to translate to.
 java.lang.String translate(java.lang.String key)
          Gets the translation of a certain keyword.
 java.lang.String[] translate(java.lang.String[] keys)
          Gets the translations of an array of keywords.
 java.lang.String[][] translate(java.lang.String[][] keys)
          Gets the translations of a table of keywords.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Translator getInstance()

setLanguage

public void setLanguage(java.lang.String lcode)
                 throws java.lang.IllegalArgumentException
Set the language to translate to.

Parameters:
lcode - The language code (en, fr, de, nl, ...).
Throws:
java.lang.IllegalArgumentException

translate

public java.lang.String translate(java.lang.String key)
Gets the translation of a certain keyword.

Parameters:
key - The key to translate.
Returns:
The translation of key.

translate

public java.lang.String[] translate(java.lang.String[] keys)
Gets the translations of an array of keywords.


translate

public java.lang.String[][] translate(java.lang.String[][] keys)
Gets the translations of a table of keywords.