aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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 /lib
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 'lib')
-rw-r--r--lib/languages.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/languages.rb b/lib/languages.rb
index 4d355ab59..42231ef56 100644
--- a/lib/languages.rb
+++ b/lib/languages.rb
@@ -187,7 +187,7 @@ class LanguageNames
'za' => 'Saɯ cueŋƅ',
'zu' => 'isiZulu'
}
- locale = locale.sub("_", "-")
+ locale = locale.sub("_", "-") # normalize
main_part = I18n::Locale::Tag::Simple.tag(locale).subtags[0]
return language_names[main_part]
end