DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Gettext (1.93.0) Monkeypatch
// there's a problem with this method in gettetxt 1.93.0 that will always append "_en" to fragment cache no matter what is your locale (in my case with memcache, but the problem might probably be in filestore mode too).
require 'gettext/rails' module GetText module Rails def normalized_locale(locale = nil) locale ||= GetText.locale ([locale.to_general, locale.to_s, locale.language, Locale.default.language, "en"].uniq & available_locales) end end end