grosser/fast_gettext — pull request #55 by fotos (2013-06-18 23:43:27+00:00)
Title: Implements reload on all repositories and the storage engine

This is a much needed feature when developing multilingual application with Rails. When we change a translation we need to see it reflected immediately on the page and then make further corrections as necessary (CSS usually). Restarting the server every time is a tedious and certainly not a viable alternative.

I got some ideas for this implementation from the sample @toupeira posted on #17.

To use this in a Rails project call `FastGettext.reload! if Rails.env.development?` in your `before_filter` or from other appropriate places (e.g we also bind a text domain to mailers and the asset pipeline).

You can use both `:mo` or `:po` but we recommend you do something like:

options[:type] = Rails.env.production? ? :mo : :po
FastGettext.add_text_domain("domain", options)

so you can easily change translations on development and then generate and use `mo` files on production.

I also added specs but feel free to suggest naming or other correction. I'd certainly want to see this pulled in. I'll enjoy closing a 3 year old issue, yay! :smile: