Skip to content

Commit 2fb3270

Browse files
dcramermattrobenolt
authored andcommitted
Merge pull request #2563 from ForkRepo/master
issue#2562, Can not select Chinese locale.
1 parent 099c99f commit 2fb3270

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/sentry/conf/locale.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
import sentry
44

55

6+
# change locale file dir name to locale code
7+
def dirname_to_local(dir_name):
8+
if '_' in dir_name:
9+
pre, post = dir_name.split('_', 1)
10+
dir_name = '{}-{}'.format(pre, post.lower())
11+
return dir_name
12+
13+
614
with open(os.path.join(os.path.dirname(sentry.__file__),
715
'locale', 'catalogs.json'), 'r') as f:
816
CATALOGS = json.load(f)['supported_locales']
17+
CATALOGS = [dirname_to_local(dirname) for dirname in CATALOGS]

0 commit comments

Comments
 (0)