private static Locale createDefaultLocale() {

    LocaleInfo defaultLocaleInfo = LocaleInfo.getCurrentLocale();
    String localeName = defaultLocaleInfo.getLocaleName();
    if ("default".equals(localeName)) {
      return ROOT;
    }
    String[] segments = localeName.split("_");
    if (segments.length == 1) {
      return new Locale(localeName);
    } else if (segments.length == 2) {
      return new Locale(segments[0], segments[1]);
    } else if (segments.length >= 3) {
      return new Locale(segments[0], segments[1], segments[2]);
    } else {
      return ROOT;
    }
  }
private static Locale createDefaultLocale ( ) { LocaleInfo defaultLocaleInfo = LocaleInfo . getCurrentLocale ( ) ; String localeName = defaultLocaleInfo . getLocaleName ( ) ; if ( "default" . equals ( localeName ) ) { return ROOT ; } String [ ] segments = localeName . split ( "_" ) ; if ( segments . length == 1 ) { return new Locale ( localeName ) ; } else if ( segments . length == 2 ) { return new Locale ( segments [ 0 ] , segments [ 1 ] ) ; } else if ( segments . length >= 3 ) { return new Locale ( segments [ 0 ] , segments [ 1 ] , segments [ 2 ] ) ; } else { return ROOT ; } }
@return the default locale.