Browse Source

Fix zh_* locale parsing

By properly searching for the first undescore
master
Mars Lan 5 years ago
committed by GitHub
parent
commit
e4b57846e7
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);
} catch (Exception e ){
// 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);
}
return locale;

Loading…
Cancel
Save