]> git.openstreetmap.org Git - rails.git/blob - config/initializers/i18n.rb
Make a branch for working on the copyright page.
[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         merge_translations(:nb, translations[:no])
16         translations[:no] = translations[:nb]
17
18         friendly = translate('en', 'time.formats.friendly')
19
20         available_locales.each do |locale|
21           time_formats = I18n.t('time.formats', :locale => locale)
22
23           unless time_formats.has_key?(:friendly)
24             store_translations(locale, :time => { :formats => { :friendly => friendly } })
25           end
26         end
27       end
28     end
29   end
30 end