Rails internationalization - locale-selector released
Just released the first public version of the
locale_selector. locale_selector is an internationalization library and provides a wrapper around the ruby-gettext gem.
You can install it simply by
gem install locale_selector
or see the complete installation instructions
- Offers a convinient way to specify the list of locales supported by your application.
- Provides a html UI control for locale selection.
- Maintains the user preference in a cookie and provides callback for saving the preference e.g. in a database.
- Offers rake tasks for maintaining the translations. The suggested translation maintenance workflow is really enterprise proven. E.g. updating single po-files according to the real world responsibility distribution.
Provides some fixes and improvements for the ruby-gettext library:
better parsing for ActiveRecord models in some edge cases:
- namespaced classes
- multiple model classes per file
- and most important - fix for models, that are loaded in environment.rb due to e.g. referencing by a observer
html escaping built into the underscore
better customization for ActiveRecord validation methods - you can now avoid including the field name if you wish
The fixes will be eventually merged into and released with the next releases of ruby-gettext. But for the impatient - just install the locale_selector with the monkey patches.
You can also browse the source code.