Hi there,
some of you may be aware of Unicode's Common Locale Data Repository
(CLDR) project and their XML dialect Locale Data Markup Language
(LDML). If not, you can read up on it at
http://unicode.org/cldr/.
Here's the thing: I think implementing a way to use the CLDR in Ruby/
Rails is would probably be a good, if not the best, idea to
internationalize both, Ruby and Rails because it seems to be the
standard when it comes to localizing. For simple overview, here's a
couple of things that the current LDML version provides:
- translated languages - so you can look up what Japanese means in
German (to save you the trouble of looking it up - it's
"Japanisch" ;-))
- script names
- country names
- date and time formats (including time zones)
- number formatting (including currencies)
- fallback rules for non-ASCII characters (like "ae" for the German
"ä")
- pluralization rules (although I don't quite get them yet)
- phone codes
- and probably much more stuff that I haven't discovered just yet.
I don't know about you but to me this sounds like most of the stuff
that's used in your everyday localization efforts.
The "problem" is that implementing this stuff with a well-thought-
through API is probably quite a bitch to do. I googled this stuff a
couple of days ago and it seems that hardly anyone bothered doing it
so far - so either it's not that important, after all, or it's really
hard to get it working. Pretty much the only implementations I've
found in _any_ language (not only Ruby) are Ruby-Gettext author Masao
Mutoh's Ruby-CLDR project (
http://www.yotabanana.com/hiki/ruby-
cldr.html) which seems to have only one version out and it dates back
to 2006 (plus, like Ruby-Gettext, the documentation isn't all that
great) and PHP localize (
http://sourceforge.net/projects/localize)
which was created on SourceForge in 2005 and never left its planning
stage.
Here's what I'd like to see in an implementation:
- A way to parse Unicodes LDML files so you can keep your locale data
up to date.
- Some way to efficiently handle the data. The XML files usually
amount to a couple megabytes in size - definitely not something you
want to keep in memory all the time if you're running a site with a
couple dozen localizations. I'm thinking of a database backend and
maybe even memcache here.
- Some kind of cool API to wrap the guts of this stuff and make it
easily accessible. I think, the Rails i18n project serves as a great
example when it comes to being unobtrusive and slim, yet effective.
- Of course, in the long run, some way to integrate it with Rails.
I really think I want to tackle this but I definitely can't do it all
by myself. I'd really like to create some kind of workgroup here
(again, like the i18n team did) and merge our skills and knowledge for
this complex project. I'd really love if everyone that's interested
(or knows someone who might be interested) leaves a message here and
afterwards - if there's enough people interested - we could meet in
IRC and discuss how to approach this and what the goals for this
project should go.
I'd love to hear your opinions about it - also if you think this whole
thing isn't worth the fuzz.
Best,
- Clemens