Skip to content

Commit

Permalink
Add support for running i18n 0.3.7 in ci
Browse files Browse the repository at this point in the history
This is the version used by Rails 2.3.x
  • Loading branch information
chrismcg committed Aug 25, 2011
1 parent 6f49a8b commit 416e13a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Gemfile.i18n_037
@@ -0,0 +1,5 @@
source :rubyforge
gemspec

gem 'i18n', '0.3.7'
gem 'activesupport', '2.3.14'
9 changes: 9 additions & 0 deletions lib/localeapp.rb
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion lib/localeapp/exception_handler.rb
Expand Up @@ -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(', ')
Expand Down

0 comments on commit 416e13a

Please sign in to comment.