Require i18n version 0.4.1 and fix monkey patch to work with it
Rails 3 pulls in i18n version 0.4.1 as a separate gem which then breaks our code if it is running on a machine with rails 3 installed as it tries to monkey patch i18n and fails, so this fix allows us to run on a machine with rails 3 installed.
This commit is contained in:
parent
39a014075a
commit
782ddc9c3e
2 changed files with 14 additions and 11 deletions
|
@ -24,6 +24,7 @@ Rails::Initializer.run do |config|
|
||||||
config.gem 'httpclient'
|
config.gem 'httpclient'
|
||||||
config.gem 'SystemTimer', :version => '>= 1.1.3', :lib => 'system_timer'
|
config.gem 'SystemTimer', :version => '>= 1.1.3', :lib => 'system_timer'
|
||||||
config.gem 'sanitize'
|
config.gem 'sanitize'
|
||||||
|
config.gem 'i18n', :version => '>= 0.4.1'
|
||||||
|
|
||||||
# Only load the plugins named here, in the order given (default is alphabetical).
|
# Only load the plugins named here, in the order given (default is alphabetical).
|
||||||
# :all can be used as a placeholder for all plugins not explicitly named
|
# :all can be used as a placeholder for all plugins not explicitly named
|
||||||
|
|
|
@ -1,20 +1,22 @@
|
||||||
module I18n
|
module I18n
|
||||||
module Backend
|
module Backend
|
||||||
module Base
|
class Simple
|
||||||
protected
|
module Implementation
|
||||||
alias_method :old_init_translations, :init_translations
|
protected
|
||||||
|
alias_method :old_init_translations, :init_translations
|
||||||
|
|
||||||
def init_translations
|
def init_translations
|
||||||
old_init_translations
|
old_init_translations
|
||||||
|
|
||||||
merge_translations(:nb, translations[:no])
|
store_translations(:nb, translations[:no])
|
||||||
translations[:no] = translations[:nb]
|
translations[:no] = translations[:nb]
|
||||||
|
|
||||||
friendly = translate('en', 'time.formats.friendly')
|
friendly = translate('en', 'time.formats.friendly')
|
||||||
|
|
||||||
available_locales.each do |locale|
|
available_locales.each do |locale|
|
||||||
unless lookup(locale, 'time.formats.friendly')
|
unless lookup(locale, 'time.formats.friendly')
|
||||||
store_translations(locale, :time => { :formats => { :friendly => friendly } })
|
store_translations(locale, :time => { :formats => { :friendly => friendly } })
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue