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 'SystemTimer', :version => '>= 1.1.3', :lib => 'system_timer'
|
||||
config.gem 'sanitize'
|
||||
config.gem 'i18n', :version => '>= 0.4.1'
|
||||
|
||||
# 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
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
module I18n
|
||||
module Backend
|
||||
module Base
|
||||
protected
|
||||
alias_method :old_init_translations, :init_translations
|
||||
class Simple
|
||||
module Implementation
|
||||
protected
|
||||
alias_method :old_init_translations, :init_translations
|
||||
|
||||
def init_translations
|
||||
old_init_translations
|
||||
def init_translations
|
||||
old_init_translations
|
||||
|
||||
merge_translations(:nb, translations[:no])
|
||||
translations[:no] = translations[:nb]
|
||||
store_translations(:nb, translations[:no])
|
||||
translations[:no] = translations[:nb]
|
||||
|
||||
friendly = translate('en', 'time.formats.friendly')
|
||||
friendly = translate('en', 'time.formats.friendly')
|
||||
|
||||
available_locales.each do |locale|
|
||||
unless lookup(locale, 'time.formats.friendly')
|
||||
store_translations(locale, :time => { :formats => { :friendly => friendly } })
|
||||
available_locales.each do |locale|
|
||||
unless lookup(locale, 'time.formats.friendly')
|
||||
store_translations(locale, :time => { :formats => { :friendly => friendly } })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue