Merge pull request #4057 from louyihua/dark_lang
Do not merge zh-hk into zh-tw in darklang
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user