﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31381	jsi18n with zh-hans (or zh-hant) not working.	tyx1703	nobody	"When language equal 'zh-hans' (or 'zh-hant', the language code which the length of second part split by '-' more than 2 has this problem), Django will occur a bug that djangojs not working 

For example: 

django will find django.mo in '/local/zh_Hant/LC_MESSAGES/django.mo'
But, when domain is 'djangojs', django find djangojs.mo in '/local/zh_hant/LC_MESSAGES/djangojs.mo'.

H case is causing the problem directly.

After debugging, I found that django call `to_locale` twice in `_get_locale` defined in the `django/views/i18n.py` when domain is djangojs, but once when domain is django


At brief:
domain: django, call `to_local` once
`zh-hans` => `to_local('zh-hans')` => `zh_Hant` => `/local/zh_Hant/LC_MESSAGES/django.mo`

domain: djangojs, call `to_local` twice
`zh-hans` => `to_local('zh-hans')` =>  `zh_Hant` => `to_local('zh_Hant')` => `zh_hant` => `/local/zh_hant/LC_MESSAGES/django.mo`"	Bug	closed	Internationalization	1.11	Normal	invalid	zh-hans djangojs		Unreviewed	0	0	0	0	0	0
