From 8f0b7b6f86dc60a51d4ffab2a5fd627fa3499b8a Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Wed, 13 Jun 2012 14:07:58 +0100 Subject: 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) --- config/initializers/fast_gettext.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config/initializers/fast_gettext.rb') 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) + + -- cgit v1.2.3