[OpenStack-I18n] [Bug 1665255] [NEW] request to OpenStack service with header "Accept-Language: zh-TW", but the response language is not
WangBinbin
bbwang5827 at fiberhome.com
Thu Feb 16 07:40:37 UTC 2017
Public bug reported:
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
** Affects: openstack-i18n
Importance: Undecided
Assignee: WangBinbin (bbwang5827)
Status: New
** Changed in: openstack-i18n
Assignee: (unassigned) => WangBinbin (bbwang5827)
--
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 openstack 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/openstack-i18n/+bug/1665255/+subscriptions
More information about the OpenStack-I18n
mailing list