Browse Source

Merge pull request #198 from mars-lan/patch-1

Fix zh_* locale parsing
master
Henning Hall 5 years ago
committed by GitHub
parent
commit
b181269d3f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      android/src/main/java/com/henninghall/date_picker/LocaleUtils.java

+ 1
- 1
android/src/main/java/com/henninghall/date_picker/LocaleUtils.java View File

@ -43,7 +43,7 @@ public class LocaleUtils {
locale = org.apache.commons.lang3.LocaleUtils.toLocale(languageTag); locale = org.apache.commons.lang3.LocaleUtils.toLocale(languageTag);
} catch (Exception e ){ } catch (Exception e ){
// Some locales can only be interpreted from country string (for instance zh_Hans_CN ) // Some locales can only be interpreted from country string (for instance zh_Hans_CN )
String firstPartOfLanguageTag = languageTag.substring(0, languageTag.indexOf(""));
String firstPartOfLanguageTag = languageTag.substring(0, languageTag.indexOf("_"));
locale = org.apache.commons.lang3.LocaleUtils.toLocale(firstPartOfLanguageTag); locale = org.apache.commons.lang3.LocaleUtils.toLocale(firstPartOfLanguageTag);
} }
return locale; return locale;

Loading…
Cancel
Save