[OpenStack-I18n] [Bug 1665255] Re: request to OpenStack service with header "Accept-Language: zh-TW", but the response language is not
Ian Y. Choi
ianyrchoi at gmail.com
Fri Feb 17 08:14:52 UTC 2017
** Project changed: openstack-i18n => oslo.i18n
** Tags added: i18n
--
You received this bug notification because you are a member of OpenStack
I18n Core Team, which is subscribed to openstack i18n.
https://bugs.launchpad.net/bugs/1665255
Title:
request to OpenStack service with header "Accept-Language: zh-TW", but
the response language is not
Status in oslo.i18n:
New
Bug description:
In my OpenStack Mitaka cluster, I want to make the service response with zh-TW language, according to the steps below.
(take the glance service as example)
1 stop glance-api service with "systemctl stop glance-api"
2 export the env with "export GLANCE_LOCALEDIR=/usr/lib/python2.7/site-packages/glance/locale/ "
3 start glance-api service with "systemctl start glance-api"
4 show image detail with wrong uuid;
curl -g -i -X GET http://192.168.51.253:9292/v2/images/8b0e2af4-178e-48bdbad30fe6e99d1ca2 H "User-Agent: python-glanceclient" -H "Content-Type: application/octet-stream" -H "X-Auth-Token: $token" -H "Accept-Language: zh-TW"
expect i18n translate the exception to zh-TW, but the response is zh-CN
https://github.com/openstack/oslo.i18n/blob/master/oslo_i18n/_gettextutils.py#L84
language_list.extend(alias for locale, alias in aliases.items()
if (locale in language_list and
alias not in language_list))
the zh_Hant is not in the language_list, so the zh_TW will not append
to the language_list
To manage notifications about this bug go to:
https://bugs.launchpad.net/oslo.i18n/+bug/1665255/+subscriptions
More information about the OpenStack-I18n
mailing list