Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Babel 1.0+ doesn't support zh_CN #37

jun66j5 opened this issue Jul 28, 2013 · 1 comment

Babel 1.0+ doesn't support zh_CN #37

jun66j5 opened this issue Jul 28, 2013 · 1 comment


Copy link

@jun66j5 jun66j5 commented Jul 28, 2013

Babel 1.0+ currently doesn't accept zh_CN. But Trac requires the locale. Probably, the other applications require it. See

Also, Trac expects str(Locale.parse('zh_TW')) is 'zh_TW'. However, Babel 1.0+ automatically expands to 'zh_Hant_TW'.

Copy link

@mitsuhiko mitsuhiko commented Jul 28, 2013

zh_TW is not a locale that the CLDR has. The canonical name of that locale is zh_Hant_TW. There is a ticket open on adding support for fuzzy locales that dynamically find the most appropriate data file.

With regards to why zh_CN does not resolve: the likely subtag expansion in Babel is currently very buggy and limited. Also related to not having fuzzy locales. There is already #30 that tracks this.


@mitsuhiko mitsuhiko closed this Jul 28, 2013
mitsuhiko added a commit that referenced this issue Jul 28, 2013
This fixes some locales not loading correctly (like zh_CN) that
are defined through simplified rules in the likely-subtag mapping.
openstack-gerrit pushed a commit to openstack-archive/oslo-incubator that referenced this issue Jan 20, 2014
Babel>=1.0,<1.3 has a bug where some OpenStack supported
locales like 'zh_CN' and 'zh_TW', aren't supported, see:

In Babel 1.3 they fixed the bug and they support these locales, but
they are still not explicitly "listed" by locale_identifiers(). That's
why we add the locales if necessary so they are listed as supported
otherwise when validating supported locales for the transalated log, we
would fail to allow them even if there are .mo files for

Change-Id: Ie61539a709808dfea690a59602be94347fcfbbb9
washort pushed a commit to mozilla/zamboni that referenced this issue Mar 17, 2015
This reverts commit 3e9ea46.

Babel 1.0+ doesn't support locale names we use such as 'zh_CN'.
See python-babel/babel#37
ccwang002 added a commit to python-doc-tw/cpython-tw that referenced this issue Feb 15, 2016
Babel parses locale 'zh_Hant' as 'zh_Hant_TW', which accepts solely
underscores and rejects any dashes. Though I don't know if this follows
the standard ISO lang code format, it is the status quo. And all the
settings can be easily switched.

Ref: python-babel/babel#37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants