Globalite Major update
Written by matt on September 2nd, 2007
I'm glad to announce a major update of Globalite.
First off I'd like to thank all the translators who helped with this release.
Globalite now support its first Asian language: Chinese! Ivan Chang did an awesome job creating a localization file in Chinese for Taiwan, Hong Kong and Main Land China. I'm really glad thinking that Globalite will make the Rails experience much nicer for a lot of Chinese people.
Ivan also pushed me to add a new feature that people had asked about: a better ActiveRecord error message support.
You know how Rails has a nice way of displaying your Model errors:

Well, now that's automatically translated in your locale. (as long as the new localization files are up to date. Feel free to contact me if you want to improve the locale file in your own language)
- I also added support for pluralization directly in the translation file. (pluralization doesn't always make sense in some languages) I'm planning on adding a better Inflector support later on.
for now, in your translation file simply use:
horse_count: we have pluralize{{count}, horse} in the ranch
In your view use the localization with arguments to pass the count:
<%= :horse_count.l_with_args({:count => @horse.count}) %>
See the wiki for more information about pluralization.
- Finally the demo app has been updated with an example of how to grab the acceptable locale from the header. (thanks to Emmanuel Bouton)
Comments
-
Hello, Congratulations on the excellent plugin! I was wondering what would be the best way to handle the following situation in Globalite:
I would like to set the language to be Spanish (or Chinese) but have the currency or date localization set to be another locale (like US or UK).
Thanks,
--Johann
-
You would need to create a new locale such as es-US for American Spanish and add it to the lang/rails folder in globalite.
The best thing would be to provide me with your new core localization file so I can add it to the plugin for everyone to use.
Here is a list of the available locales:
http://globalite.googlecode.com/svn/trunk/lang/rails/
look at http://globalite.googlecode.com/svn/trunk/lang/rails/en-US.yml for an example of a Rails core localization file.
To create American Spanish for instance, I would copy the Spanish file, get it reviewed by an Hispanic living the US and change the currency and date settings.
-
Thanks Matt, That sounds like a very clean solution. I will let you know.
--Johann
-
Hi,
How do you localize 'Body', 'Title' or 'Author' in your error message exemple ?
Great job.
-
Help ^


