From: Tom Hughes Date: Fri, 22 May 2009 23:49:08 +0000 (+0000) Subject: Altered to match rails 2.3.2 implementation. X-Git-Tag: live~7335^2~77 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/68eeaabb9d8092ef20bec0271bef85e37cda2db8 Altered to match rails 2.3.2 implementation. --- diff --git a/config/initializers/available_locales.rb b/config/initializers/available_locales.rb index 171d0c66a..518b6d376 100644 --- a/config/initializers/available_locales.rb +++ b/config/initializers/available_locales.rb @@ -2,22 +2,20 @@ # See http://rails-i18n.org/wiki/pages/i18n-available_locales module I18n class << self - def available_locales; backend.available_locales; end + def available_locales + backend.available_locales + end end module Backend class Simple - def available_locales; translations.keys.collect { |l| l.to_s }.sort; end - def langs; translations.values end + def available_locales + init_translations unless initialized? + translations.keys + end end end end -# You need to "force-initialize" loaded locales -I18n.backend.send(:init_translations) - -#AVAILABLE_LOCALES = I18n.backend.available_locales -#RAILS_DEFAULT_LOGGER.debug "* Loaded locales: #{AVAILABLE_LOCALES.inspect}" - LANGUAGES = { "en" => "English", "de" => "Deutsch"