aboutsummaryrefslogtreecommitdiffstats
path: root/config/initializers/fast_gettext.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-06-13 14:07:58 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-06-13 14:07:58 +0100
commit8f0b7b6f86dc60a51d4ffab2a5fd627fa3499b8a (patch)
tree76bdde02413edcf9bc578195ef530576c44a2cd1 /config/initializers/fast_gettext.rb
parent50eb7689c7d6339f8a28350d9ed3776e2626924a (diff)
Fix it so we can correctly use and display locales that contain an underscore (e.g. `hu_HU`):
* Use the latest version of `gettext_i18n_rails` (including fix to make it work in Railes 2.x) * Use a backend that falls back to, for example, `hu` from `hu_HU` (so we can use any underlying Rails l10n) * Normalize the underscore to a hyphen when working out which languages to display in the language switcher Fixes #503 (and see there for more discussion)
Diffstat (limited to 'config/initializers/fast_gettext.rb')
-rw-r--r--config/initializers/fast_gettext.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/config/initializers/fast_gettext.rb b/config/initializers/fast_gettext.rb
index 9049fd8ed..721c49cd0 100644
--- a/config/initializers/fast_gettext.rb
+++ b/config/initializers/fast_gettext.rb
@@ -1,3 +1,7 @@
Encoding.default_external = 'UTF-8' if RUBY_VERSION.to_f >= 1.9
FastGettext.add_text_domain 'app', :path => File.join(Rails.root, 'locale'), :type => :po
FastGettext.default_text_domain = 'app'
+
+I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
+
+