ENGLISH, FRENCH, GERMAN, new Locale("ga", "") };
String[] localeNames = LocaleData.localeNames; availableLocales = new Locale[localeNames.length];  for (int i = 0; i < localeNames.length; i++) { String language; String region = ""; String variant = ""; String name = localeNames[i];  language = name.substring(0, 2);  if (name.length() > 2) region = name.substring(3);  int index = region.indexOf("_"); if (index > 0) { variant = region.substring(index + 1); region = region.substring(0, index - 1); }  availableLocales[i] = getLocale(language, region, variant); } }  return availableLocales;
  public static Locale[] getAvailableLocales()  {    /* I only return those for which localized language     * or country information exists.     * XXX - remove hard coded list, and implement more locales (Sun's JDK 1.4     * has 148 installed locales!).     */    return new Locale[]    {      ENGLISH, FRENCH, GERMAN, new Locale("ga", "")    };    }