-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Larify
committed
May 18, 2021
1 parent
ccda7a1
commit c3214e1
Showing
3 changed files
with
43 additions
and
8 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import os | ||
|
||
langs = { | ||
'en_US' : { | ||
"DEFAULT_TITLE" : u'Search word', | ||
"DEFAULT_SUBTITLE" : u'Please input a english word.', | ||
"DEFAULT_ERROR" : u'Word not found.' | ||
}, | ||
'zh_CN' : { | ||
"DEFAULT_TITLE" : u'爱词霸查词', | ||
"DEFAULT_SUBTITLE" : u'请输入需要查询的英文单词', | ||
"DEFAULT_ERROR" : u'没有查到单词的释义' | ||
} | ||
} | ||
|
||
local = os.popen('defaults read -g AppleLocale').read().rstrip() | ||
|
||
try: | ||
dic = langs[local] | ||
except KeyError as e: | ||
dic = langs['zh_CN'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters