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

Allow some form of Babel supplied locales if not supplied by CLDR #55

Closed
icarito opened this issue Sep 15, 2013 · 6 comments
Closed

Allow some form of Babel supplied locales if not supplied by CLDR #55

icarito opened this issue Sep 15, 2013 · 6 comments

Comments

@icarito
Copy link

icarito commented Sep 15, 2013

From http://babel.edgewall.org/ticket/258:
"If CLDR does not provide some locale, e.g. Asturian (#254), then we should provide a mechanism that allows the locale identifier to be used as well as to be overriden with user data to support said locale."

In my case, I'm trying to add support for Aymara, which locales were recently submitted to GLIBC for inclusion ( http://sourceware.org/bugzilla/show_bug.cgi?id=14828 ) . Now I'm dumbfounded by learning that Babel doesn't use the glibc locales but something else called CLDR.

It would be great if I could simply use the glibc localedata.

@icarito
Copy link
Author

icarito commented Sep 15, 2013

I've managed to work around by copying the spanish (es.dat) in babel/localedata. I can't read this .dat file, what format is it, and how do I generate a new one? Is is possible to generate one from the Glibc data available at https://sourceware.org/bugzilla/attachment.cgi?id=6726 ? Help is appreciated.

@mgax
Copy link
Contributor

mgax commented Jan 6, 2014

Files in babel/localedata are generated by running make import-cldr, which downloads and parses the CLDR database, and saves pickle files for each locale. There is no way to read glibc locale files.

@srl295
Copy link

srl295 commented Jul 8, 2014

@icarito please instead consider submitting the data to CLDR - http://cldr.unicode.org

@etanol
Copy link
Contributor

etanol commented Oct 8, 2015

Indeed, the right approach for supporting new locales or updating existing ones is to contribute directly to CLDR. This way the effort is concentrated since many more libraries and frameworks depend on it.

@etanol etanol closed this as completed Oct 8, 2015
@srl295
Copy link

srl295 commented Oct 8, 2015

if anything, given the above, you could write your files in CLDR format (which you should anyways to contribute to CLDR) and then run the import manually.

@etanol
Copy link
Contributor

etanol commented Oct 8, 2015

@srl295 that wouldn't work. The CLDR data is imported at release time. That is, as part of the packaging process, the XML files are parsed and a custom serialized format is generated for each locale, so Babel loads locale data faster and in a native way.

API compatibility is maintained as much as possible. However, the exact format of the babel data files is opaque and not formally defined. This means that the exchange of locale data files across different Babel versions is not supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants