code: private List<Locale> extractLocales(List<List<String>> allLangs) {
          List<Locale> rc = new ArrayList<Locale>();
          for (List<String> langList : allLangs) {
              for (String language : langList) {
                  String country = "";
                  String variant = "";
                  int countryIndex = language.indexOf('-');
                  if (countryIndex > -1) {
                      int variantIndex = language.indexOf('-', (countryIndex + 1));
                      if (variantIndex > -1) {
                          variant = language.substring(variantIndex + 1).trim();
                          country = language.substring(countryIndex, variantIndex).trim();
                      } else {
                          country = language.substring(countryIndex + 1).trim();
                      }
                      language = language.substring(0, countryIndex).trim();
                  }
  
                  rc.add(new Locale(language, country, variant));
              }
          }
  
          return rc;
      }
docs: Extract the locales from a passed in language list.
  
  @param allLangs
  @return List<Locale>