Merge -r 20198:20540 from trunc into openstreetbugs branch
[rails.git] / config / initializers / i18n.rb
1 require 'globalize/i18n/missing_translations_log_handler'
2
3 I18n.missing_translations_logger = Logger.new("#{RAILS_ROOT}/log/missing_translations.log")
4 I18n.exception_handler = :missing_translations_log_handler
5
6 module I18n
7   module Backend
8     class Simple
9       protected
10       alias_method :old_init_translations, :init_translations
11       
12       def init_translations
13         old_init_translations
14
15         friendly = translate('en', 'time.formats.friendly')
16
17         available_locales.each do |locale|
18           time_formats = I18n.t('time.formats', :locale => locale)
19
20           unless time_formats.has_key?(:friendly)
21             store_translations(locale, :time => { :formats => { :friendly => friendly } })
22           end
23         end
24       end
25     end
26   end
27 end