Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
6d783900
Commit
6d783900
authored
Jun 12, 2014
by
louyihua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not merge zh-hk into zh-tw in darklang
parent
beca9b51
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
common/djangoapps/dark_lang/middleware.py
+1
-2
common/djangoapps/dark_lang/tests.py
+3
-3
No files found.
common/djangoapps/dark_lang/middleware.py
View file @
6d783900
...
...
@@ -44,11 +44,10 @@ CHINESE_LANGUAGE_CODE_MAP = {
'zh-hans-cn'
:
'zh-CN'
,
# Chinese (Simplified, China)
'zh-hans-sg'
:
'zh-CN'
,
# Chinese (Simplified, Singapore)
'zh-hant'
:
'zh-TW'
,
# Chinese (Traditional)
'zh-hant-hk'
:
'zh-
TW
'
,
# Chinese (Traditional, Hongkong)
'zh-hant-hk'
:
'zh-
HK
'
,
# Chinese (Traditional, Hongkong)
'zh-hant-mo'
:
'zh-TW'
,
# Chinese (Traditional, Macau)
'zh-hant-tw'
:
'zh-TW'
,
# Chinese (Traditional, Taiwan)
# The following are the old-style language codes that django does not recognize
'zh-hk'
:
'zh-TW'
,
# Chinese (Traditional, Hongkong)
'zh-mo'
:
'zh-TW'
,
# Chinese (Traditional, Macau)
'zh-sg'
:
'zh-CN'
,
# Chinese (Simplified, Singapore)
}
...
...
common/djangoapps/dark_lang/tests.py
View file @
6d783900
...
...
@@ -217,12 +217,12 @@ class DarkLangMiddlewareTests(TestCase):
def
test_accept_chinese_language_codes
(
self
):
DarkLangConfig
(
released_languages
=
(
'zh-cn, zh-tw'
),
released_languages
=
(
'zh-cn, zh-
hk, zh-
tw'
),
changed_by
=
self
.
user
,
enabled
=
True
)
.
save
()
self
.
assertAcceptEquals
(
'zh-CN;q=1.0, zh-TW;q=0.5, zh-
TW
;q=0.3'
,
self
.
process_request
(
accept
=
'zh-Hans;q=1.0, zh-Hant-TW;q=0.5, zh-
hk
;q=0.3'
)
'zh-CN;q=1.0, zh-TW;q=0.5, zh-
HK
;q=0.3'
,
self
.
process_request
(
accept
=
'zh-Hans;q=1.0, zh-Hant-TW;q=0.5, zh-
HK
;q=0.3'
)
)
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