railway

i18n demo application grows up

Thanks to the press my i18n demo application received lately (blog posts at Rails Inside and the Riding Rails Blog plus mention in the Rails Envy Podcast #42), there have been a number of contributions to the app. Mostly, these were additional locales so that the app now offers complete translations for the following languages:

  • US English
  • Portuguese (Brazilian)
  • Australian English
  • Japanese
  • Thai
  • Spanish (Argentinean)

In addition, Masayuki Nakamura and Simon Tokumine took the time and introduced content translations so now not only the Rails parts are localized but also the tutorial content itself! To be honest, this is not what I had in mind when I wrote the demo application but it’s a great addition nonetheless! Thanks so much for the effort, guys!

If you want to add a new translation of the app, that would be great! It’s pretty simple to do:

  • Fork my repo at GitHub.
  • Add a translation file in config/locales.
  • Copy the contents of one of the complete translations (e.g. en-US.rb) and use this as a base for your translation.
  • Add your name and optionally a link to your website to the list in app/views/pages/about.html.erb.
  • When you’re done, push the changes to your repo and pull request me.
  • I will then review your additions and merge it into my original repo.

The demo app now also supports the latest additions to the Rails i18n plugin, namely loading locales from YAML files. I’ve implemented a demonstration for this in the en-US locale. Note that YAML files are the new default storage method for translations, except if the translations contain any complex Ruby constructs such as lambdas - see the :long_ordinal date/time format in the en-US.rb locale if you want an example.

If you want to take a peek at the demo app without installing it, it’s running live over at http://i18n-demo.phusion.nl. Thanks for hosting it!

I’m really looking forward to seeing the changes/additions that you guys propose for the demo app over the next few weeks. If you need any help on how to contribute, feel free to ping me in IRC - I usually hang in #rails-contrib under the name “clemensk”.