Пример #1
0
 static {
   Locale locale = Locale.getDefault();
   COUNTRY = locale == null ? DEFAULT_COUNTRY : locale.getCountry();
   String language = locale == null ? DEFAULT_LANGUAGE : locale.getLanguage();
   // Special case Chinese
   if (Locale.SIMPLIFIED_CHINESE.getLanguage().equals(language)) {
     language += "-r" + COUNTRY;
   }
   LANGUAGE = language;
 }
Пример #2
0
 private static String getSystemLanguage() {
   Locale locale = Locale.getDefault();
   if (locale == null) {
     return DEFAULT_LANGUAGE;
   }
   String language = locale.getLanguage();
   // Special case Chinese
   if (Locale.SIMPLIFIED_CHINESE.getLanguage().equals(language)) {
     return language + "-r" + getSystemCountry();
   }
   return language;
 }