org.jmol.i18n
Class GT
public
class
GT
extends Object
Method Summary |
void | addBundle(String name_lang) |
void | addBundles(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 String | escapeHTML(String msg) |
String | findClosest(String la)
|
static boolean | getDoTranslate() |
static String | getLanguage() |
static GT.Language[] | getLanguageList() |
String | getString(String string) |
String | getString(String string, Object[] objects) |
String | getSupported(String languageCode, boolean isExact) |
static GT | getTextWrapper() |
void | getTranslation(String langCode) |
static void | ignoreApplicationBundle() |
static void | setDoTranslate(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) |
private boolean doTranslate
private static
GT getTextWrapper
private static boolean ignoreApplicationBundle
private String language
private ResourceBundle[] translationResources
private int translationResourcesCount
public GT(String la)
private GT()
private void addBundle(String name_lang)
private void addBundles(String type, String la_co_va, String la_co, String la)
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
public static String escapeHTML(String msg)
private String findClosest(String la)
Parameters: la
Returns: a localization of the desired language, but not it exactly
public static boolean getDoTranslate()
public static String getLanguage()
private String getString(String string)
private String getString(String string, Object[] objects)
private String getSupported(String languageCode, boolean isExact)
private static
GT getTextWrapper()
private void getTranslation(String langCode)
public static void ignoreApplicationBundle()
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)