uic.helpers
Class UICTranslator

java.lang.Object
  |
  +--uic.helpers.Translator
        |
        +--uic.helpers.UICTranslator

public class UICTranslator
extends Translator


Constructor Summary
UICTranslator()
           
 
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

UICTranslator

public UICTranslator()
Method Detail

translate

public String translate(String in)
Description copied from class: Translator
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.

Overrides:
translate in class Translator

getButtonText

public String getButtonText(String in)
Description copied from class: Translator
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.

Overrides:
getButtonText in class Translator

getMnemonic

public String getMnemonic(String in)
Description copied from class: Translator
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.

Overrides:
getMnemonic in class Translator


Copyright © 2002,2003 Thomas Zander