Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
bbf61448
Commit
bbf61448
authored
Oct 09, 2016
by
Mygod
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine unexpected cases for Chinese locales
parent
396d31a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
src/main/scala/com/github/shadowsocks/ShadowsocksApplication.scala
...scala/com/github/shadowsocks/ShadowsocksApplication.scala
+13
-0
No files found.
src/main/scala/com/github/shadowsocks/ShadowsocksApplication.scala
View file @
bbf61448
...
...
@@ -48,6 +48,7 @@ import android.content.res.Configuration
import
android.os.
{
Build
,
LocaleList
}
import
android.preference.PreferenceManager
import
android.support.v7.app.AppCompatDelegate
import
android.util.Log
import
com.github.shadowsocks.database.
{
DBHelper
,
ProfileManager
}
import
com.github.shadowsocks.utils.
{
Key
,
TcpFastOpen
,
Utils
}
import
com.google.android.gms.analytics.
{
GoogleAnalytics
,
HitBuilders
,
StandardExceptionParser
}
...
...
@@ -58,6 +59,9 @@ import com.j256.ormlite.logger.LocalLog
object
ShadowsocksApplication
{
var
app
:
ShadowsocksApplication
=
_
private
final
val
TAG
=
"ShadowsocksApplication"
// The ones in Locale doesn't have script included
private
final
lazy
val
SIMPLIFIED_CHINESE
=
Locale
.
forLanguageTag
(
"zh-Hans-CN"
)
private
final
lazy
val
TRADITIONAL_CHINESE
=
Locale
.
forLanguageTag
(
"zh-Hant-TW"
)
}
...
...
@@ -99,6 +103,15 @@ class ShadowsocksApplication extends Application {
case
_
=>
locale
.
getScript
match
{
// fallback to the corresponding script
case
"Hans"
=>
SIMPLIFIED_CHINESE
case
"Hant"
=>
TRADITIONAL_CHINESE
case
script
=>
Log
.
w
(
TAG
,
"Unknown zh locale script: %s. Falling back to trying countries..."
.
format
(
script
))
locale
.
getCountry
match
{
case
"SG"
=>
SIMPLIFIED_CHINESE
case
"HK"
|
"MO"
=>
TRADITIONAL_CHINESE
case
_
=>
Log
.
w
(
TAG
,
"Unknown zh locale: %s. Falling back to zh-Hans-CN..."
.
format
(
locale
.
toLanguageTag
))
SIMPLIFIED_CHINESE
}
}
}
else
null
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment