uic.helpers
Class Translator

java.lang.Object
  |
  +--uic.helpers.Translator
Direct Known Subclasses:
UICTranslator

public class Translator
extends Object

Dummy class for translating strings in the GUI to do localisation.


Constructor Summary
Translator()
           
 
Method Summary
 String getButtonText(String in)
          In Qt the '&' in front of a character represents a mnemonic; but should not be visible on buttons; this method returns the string sans the '&'.
 String getMnemonic(String in)
          In Qt the '&' in front of a character represents a mnemonic; but should not be visible on buttons; this method returns the first character that follows the '& char.
 String translate(String in)
          This is a simple implementation to do translation (i18n) of the input string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Translator

public Translator()
Method Detail

translate

public String translate(String in)
This is a simple implementation to do translation (i18n) of the input string. Since this is a dummy class this method will do very little except make escape the string so '"' will be '\"' in the output.

The usage of this method (in extending classes) would be to translate text from the user-interface input file to the output. A simple example is that the implementation of this method will translate 'back' to 'terug' since my dictionairy says that that is the translation for my locale.

Most i18n implementions have a slightly more intelligent localisation and do the translation of strings at runtime. A call to something like StaticTranslator.translateString(in) seems more appropriate.


getButtonText

public String getButtonText(String in)
In Qt the '&' in front of a character represents a mnemonic; but should not be visible on buttons; this method returns the string sans the '&'.

An extending class would call this method _after_ it has done the actual translation of the string.


getMnemonic

public String getMnemonic(String in)
In Qt the '&' in front of a character represents a mnemonic; but should not be visible on buttons; this method returns the first character that follows the '& char.

An extending class would call this method _after_ it has done the actual translation of the string.



Copyright © 2002,2003 Thomas Zander