Closed jianaijun closed 11 years ago
I think it would be best to split on both - and _ so that we don't break backwards compatibility for anyone who was assuming they could pass POSIX-style locale identifiers. Adding support for IETF-style language codes does seem like a good idea though.
zope/publisher/browser.py always return '-',
refer: https://dev.plone.org/ticket/13309 https://github.com/plone/plone.i18n/blob/master/plone/i18n/normalizer/adapters.py#L30 http://svn.zope.org/zope.publisher/tags/3.4.2/src/zope/publisher/browser.py?rev=82183&view=markup
I know Plone uses IETF-style codes when it calls this normalizer, but this is a plone.* package which may be used as a library outside Plone, so we can't draw conclusions based only on studying how it is used within Plone. I'm going to make it also split on _ so we don't lose support for dealing with POSIX-style locale identifiers.
Thank you for your reply. zope.i18n uses IETF-style codes.
Refer: http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.10 http://www.gnu.org/software/gettext/manual/gettext.html#Locale-Names