]> git.openstreetmap.org Git - rails.git/blob - config/initializers/available_locales.rb
Don't ask the backend directly for the available locales - just ask
[rails.git] / config / initializers / available_locales.rb
1 # Get loaded locales conveniently
2 # See http://rails-i18n.org/wiki/pages/i18n-available_locales
3 module I18n
4   class << self
5     def available_locales; backend.available_locales; end
6   end
7   module Backend
8     class Simple
9       def available_locales; translations.keys.collect { |l| l.to_s }.sort; end
10         def langs; translations.values end
11     end
12   end
13 end
14
15 # You need to "force-initialize" loaded locales
16 I18n.backend.send(:init_translations)
17
18 #AVAILABLE_LOCALES = I18n.backend.available_locales
19 #RAILS_DEFAULT_LOGGER.debug "* Loaded locales: #{AVAILABLE_LOCALES.inspect}"
20
21 LANGUAGES = 
22 { "en" => "English",
23   "de" => "Deutsch"
24   }