Package org.jmol.i18n

Class Language

java.lang.Object
org.jmol.i18n.Language

public class Language extends Object
  • Field Details

    • code

      public final String code
    • language

      public final String language
    • nativeLanguage

      public final String nativeLanguage
    • display

      public boolean display
  • Constructor Details

    • Language

      private Language(String code, String language, String nativeLanguage, boolean display)
      Parameters:
      code - Language code (see ISO 639-1 for the values)
      language - Language name in English (see ISO 639-1 for the values)
      nativeLanguage - Language name in its own language (see ISO 639-1 for the values)
      display - True if this language has a good percentage of translations done
      invalid @link
      {@link "http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes"
      }
  • Method Details

    • getLanguageList

      public static Language[] getLanguageList()
      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
    • getSupported

      static String getSupported(Language[] list, String code)