variant = region.substring(index + 1); region = region.substring(0, index - 1);
variant = country.substring(index + 1); country = country.substring(0, index - 1);
  public static synchronized Locale[] getAvailableLocales()  {    if (availableLocales == null)    {        int len = LocaleHelper.getLocaleCount();        availableLocales = new Locale[len];        for (int i = 0; i < len; i++)          {            String language;            String region = "";            String variant = "";            String name = LocaleHelper.getLocaleName(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 (Locale[]) availableLocales.clone();    }