saGii
saGii

Reputation: 477

disable caching for i18n phrases rails 3

I'm new to building a rails 3 app with multiple language support. The product requires that the translation team should be able to updated phrases from web interface and see its effects on refresh. They are not concerned about the performance hit this model carries.

So i'm using the gem i18n-active_record and its backend with i18n. The problem is, that translations stored in the db are not fetched on every request. I want the system to query the translations table for each key every time it gets the rendering request.

We're to disable this later when the site is mature enough, but this is an essential feature for now. Any ideas?

Upvotes: 2

Views: 1388

Answers (2)

Juri Glass
Juri Glass

Reputation: 91503

You could add in your ApplicationController:

before_filter { I18n.reload! }

Upvotes: 1

tigrish
tigrish

Reputation: 2518

I'm afraid I can't really comment on using i18n-active_record, but we run a staging server with the localeapp gem running in daemon mode. This means that translations can be editing via a GUI by a translator and they appear instantly on the staging server. Might be something worth looking into for you.

Disclosure: I'm a developer for Locale

Upvotes: 0

Related Questions