diff --git a/Gemfile.i18n_037 b/Gemfile.i18n_037 new file mode 100644 index 0000000..ef5c6da --- /dev/null +++ b/Gemfile.i18n_037 @@ -0,0 +1,5 @@ +source :rubyforge +gemspec + +gem 'i18n', '0.3.7' +gem 'activesupport', '2.3.14' diff --git a/lib/localeapp.rb b/lib/localeapp.rb index e32babc..7d313dd 100644 --- a/lib/localeapp.rb +++ b/lib/localeapp.rb @@ -5,12 +5,21 @@ # we're in 2.3 and we need to load rails to get the vendored i18n require 'thread' # for rubygems > 1.6.0 support require 'active_support' + # This ugliness so we can load AS in the travis env + @loaded_active_support = true end begin require 'i18n/core_ext/hash' rescue LoadError + # This ugliness so we can load AS in the travis env # Assume that we're in rails 2.3 and AS supplies deep_merge + # Load AS if we need to + unless @loaded_active_support + # we're in 2.3 and we need to load rails to get the vendored i18n + require 'thread' # for rubygems > 1.6.0 support + require 'active_support' + end end require 'localeapp/i18n_shim' diff --git a/lib/localeapp/exception_handler.rb b/lib/localeapp/exception_handler.rb index 7759be8..c339ebd 100644 --- a/lib/localeapp/exception_handler.rb +++ b/lib/localeapp/exception_handler.rb @@ -7,7 +7,7 @@ def self.call(exception, locale, key, options) Localeapp.log("Detected missing translation for key(s) #{key.inspect}") [*key].each do |key| - Localeapp.missing_translations.add(locale, key, options) + Localeapp.missing_translations.add(locale, key, options || {}) end [locale, key].join(', ')