Commit 01712614 authored by Mygod's avatar Mygod

Fix a crash on Android 4.4

parent 273eca7b
...@@ -93,8 +93,8 @@ class ShadowsocksApplication extends Application { ...@@ -93,8 +93,8 @@ class ShadowsocksApplication extends Application {
} }
private def checkChineseLocale(locale: Locale): Locale = if (locale.getLanguage == "zh") locale.getCountry match { private def checkChineseLocale(locale: Locale): Locale = if (locale.getLanguage == "zh") locale.getCountry match {
case "CN" | "TW" => null // already supported case "CN" | "TW" => null
case _ => locale.getScript match { // fallback to the corresponding script case _ => (if (Build.VERSION.SDK_INT >= 21) locale.getScript else null) match {
case "Hans" => SIMPLIFIED_CHINESE case "Hans" => SIMPLIFIED_CHINESE
case "Hant" => TRADITIONAL_CHINESE case "Hant" => TRADITIONAL_CHINESE
case script => case script =>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment