shortLocale method

String shortLocale (String aLocale)

Return the short version of a locale name, e.g. 'en_US' => 'en'

Implementation

static String shortLocale(String aLocale) {
  if (aLocale.length < 2) return aLocale;
  return aLocale.substring(0, 2).toLowerCase();
}