org.jmol.i18n

Class GT

public class GT extends Object

Nested Class Summary
static classGT.Language
Field Summary
booleandoTranslate
static GTgetTextWrapper
static booleanignoreApplicationBundle
Stringlanguage
static GT.Language[]languageList
ResourceBundle[]translationResources
inttranslationResourcesCount
Constructor Summary
GT(String la)
GT()
Method Summary
voidaddBundle(String name_lang)
voidaddBundles(String type, String la_co_va, String la_co, String la)
GT.Language[]createLanguageList()
This is the place to put the list of supported languages.
static StringescapeHTML(String msg)
StringfindClosest(String la)
static booleangetDoTranslate()
static StringgetLanguage()
static GT.Language[]getLanguageList()
StringgetString(String string)
StringgetString(String string, Object[] objects)
StringgetSupported(String languageCode, boolean isExact)
static GTgetTextWrapper()
voidgetTranslation(String langCode)
static voidignoreApplicationBundle()
static voidsetDoTranslate(boolean TF)
static String_(String string)
static String_(String string, String item)
static String_(String string, int item)
static String_(String string, Object[] objects)
static String_(String string, boolean t)
static String_(String string, String item, boolean t)
static String_(String string, int item, boolean t)
static String_(String string, Object[] objects, boolean t)

Field Detail

doTranslate

private boolean doTranslate

getTextWrapper

private static GT getTextWrapper

ignoreApplicationBundle

private static boolean ignoreApplicationBundle

language

private String language

languageList

private static GT.Language[] languageList

translationResources

private ResourceBundle[] translationResources

translationResourcesCount

private int translationResourcesCount

Constructor Detail

GT

public GT(String la)

GT

private GT()

Method Detail

addBundle

private void addBundle(String name_lang)

addBundles

private void addBundles(String type, String la_co_va, String la_co, String la)

createLanguageList

private GT.Language[] createLanguageList()
This is the place to put the list of supported languages. It is accessed by JmolPopup to create the menu list. Note that the names are in GT._ even though we set doTranslate false. That ensures that the language name IN THIS LIST is untranslated, but it provides the code xgettext needs in order to provide the list of names that will need translation by translators (the .po files). Later, in JmolPopup.updateLanguageMenu(), GT._() is used again to create the actual, localized menu item name. list order: The order presented here is the order in which the list will be presented in the popup menu. In addition, the order of variants is significant. In all cases, place common-language entries in the following order: la_co_va la_co la In addition, there really is no need for "la" by itself. Every translator introduces a bias from their originating country. It would be perfectly fine if we had NO "la" items, and just la_co. Thus, we could have just: pt_BR pt_PT In this case, the "default" language translation should be entered LAST. If a user selects pt_ZQ, the code below will find (a) that we don't support pt_ZQ, (b) that we don't support pt_ZQ_anything, (c) that we don't support pt, and, finally, that we do support pt_PT, and it will select that one, returning to the user the message that language = "pt_PT" instead of pt_ZQ. For that matter, we don't even need anything more than la_co_va because the algorithm will track that down from anything starting with la, and in all cases find the closest match. Introduced in Jmol 11.1.34 Author Bob Hanson May 7, 2007

Returns: list of codes and untranslated names

escapeHTML

public static String escapeHTML(String msg)

findClosest

private String findClosest(String la)

Parameters: la

Returns: a localization of the desired language, but not it exactly

getDoTranslate

public static boolean getDoTranslate()

getLanguage

public static String getLanguage()

getLanguageList

public static GT.Language[] getLanguageList()

getString

private String getString(String string)

getString

private String getString(String string, Object[] objects)

getSupported

private String getSupported(String languageCode, boolean isExact)

getTextWrapper

private static GT getTextWrapper()

getTranslation

private void getTranslation(String langCode)

ignoreApplicationBundle

public static void ignoreApplicationBundle()

setDoTranslate

public static void setDoTranslate(boolean TF)

_

public static String _(String string)

_

public static String _(String string, String item)

_

public static String _(String string, int item)

_

public static String _(String string, Object[] objects)

_

public static String _(String string, boolean t)

_

public static String _(String string, String item, boolean t)

_

public static String _(String string, int item, boolean t)

_

public static String _(String string, Object[] objects, boolean t)