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:
Tom Hughes 2010-09-02 19:01:21 +01:00
parent 39a014075a
commit 782ddc9c3e
2 changed files with 14 additions and 11 deletions

View file

@ -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

View file

@ -1,13 +1,14 @@
module I18n
module Backend
module Base
class Simple
module Implementation
protected
alias_method :old_init_translations, :init_translations
def init_translations
old_init_translations
merge_translations(:nb, translations[:no])
store_translations(:nb, translations[:no])
translations[:no] = translations[:nb]
friendly = translate('en', 'time.formats.friendly')
@ -19,6 +20,7 @@ module I18n
end
end
end
end
module PluralizationFallback
def pluralize(locale, entry, count)