org.equanda.translations
Class Parser

java.lang.Object
  extended by org.equanda.translations.Parser

public class Parser
extends Object

Class to parse the file with translations and build the structure used in GUI for it The file is expected to be in this form:

.languages en;nl;ro;fr .key key1/context1 .label.en key1 in english .label.nl key1 in dutch .label.fr key1 in french .label.ro key1 in romanian .caption.en key1 in english .caption.nl key1 in dutch .caption.fr key1 in french .caption.ro key1 in romanian .help.en key1 in english .help.nl key1 in dutch .help.fr key1 in french .help.ro key1 in romanian

+ more keys. /context can be missing Any of the .label, .caption, .help can be missing

Any value that ends in an underscore will have that last character replaced by a space.

Author:
Florin, Joachim Van der Auwera

Field Summary
static String CAPTION_SECTION
           
static String HELP_SECTION
           
static String KEY_SECTION
           
static String LABEL_SECTION
           
static String LANGUAGES_SECTION
           
static char TO_BECOME_SPACE
           
 
Constructor Summary
Parser()
           
 
Method Summary
 String[] getLanguages()
           
 TreeMap<String,TreeMap<Key,Translation>> getTranslations()
           
 TreeMap<Key,Translation> getTranslations(String language)
           
 void parse(File file)
           
protected  void parse(InputStream stream)
           
 void parse(String fileName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LANGUAGES_SECTION

public static final String LANGUAGES_SECTION
See Also:
Constant Field Values

KEY_SECTION

public static final String KEY_SECTION
See Also:
Constant Field Values

LABEL_SECTION

public static final String LABEL_SECTION
See Also:
Constant Field Values

CAPTION_SECTION

public static final String CAPTION_SECTION
See Also:
Constant Field Values

HELP_SECTION

public static final String HELP_SECTION
See Also:
Constant Field Values

TO_BECOME_SPACE

public static final char TO_BECOME_SPACE
See Also:
Constant Field Values
Constructor Detail

Parser

public Parser()
Method Detail

parse

public void parse(String fileName)
           throws IOException
Throws:
IOException

parse

public void parse(File file)
           throws IOException
Throws:
IOException

parse

protected void parse(InputStream stream)
              throws IOException
Throws:
IOException

getLanguages

public String[] getLanguages()

getTranslations

public TreeMap<Key,Translation> getTranslations(String language)

getTranslations

public TreeMap<String,TreeMap<Key,Translation>> getTranslations()


Copyright © 2007-2009. All Rights Reserved.