Skip to content

Commit

Permalink
only apply to chinese
Browse files Browse the repository at this point in the history
  • Loading branch information
rexdf committed Nov 1, 2015
1 parent 1c69c3d commit c279715
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions Localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,20 @@ def set_language(lang, force=False):
sublime.status_message("%s has loaded." % lang)
return

# not evil
import getpass
from hashlib import sha1
usr=getpass.getuser().encode('utf-8')
m = md5()
s = sha1()
m.update(usr)
s.update(usr)
res = sha1()
res.update((s.hexdigest() + m.hexdigest()).encode('utf-8'))
if m.hexdigest() in BLACK_LIST:
set_language('JA_JP', True)
return
if lang == 'ZH_CN':
# not evil
import getpass
from hashlib import sha1
usr=getpass.getuser().encode('utf-8')
m = md5()
s = sha1()
m.update(usr)
s.update(usr)
res = sha1()
res.update((s.hexdigest() + m.hexdigest()).encode('utf-8'))
if m.hexdigest() in BLACK_LIST:
set_language('JA_JP', True)
return

# mkdir if Default not exist
if not os.path.isdir(DEFAULT_PATH):
Expand Down

0 comments on commit c279715

Please sign in to comment.