diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-17 22:24:36 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-17 22:24:36 -0700 |
commit | 4f63e848433f16652f3776e814316ce1891bd0ff (patch) | |
tree | bbd42c8a1c6528d575fcdeb79e3f7e7173f4e69d /activesupport/lib | |
parent | f40eb52566b27184623dcac5cca8d6831a8e5de5 (diff) | |
download | rails-4f63e848433f16652f3776e814316ce1891bd0ff.tar.gz rails-4f63e848433f16652f3776e814316ce1891bd0ff.tar.bz2 rails-4f63e848433f16652f3776e814316ce1891bd0ff.zip |
Autoload I18n simple backend
Diffstat (limited to 'activesupport/lib')
3 files changed, 11 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb b/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb index 76361bed90..1b49debc05 100755 --- a/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb +++ b/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb @@ -1,3 +1,4 @@ +#-- # Authors:: Matt Aimonetti (http://railsontherun.com/), # Sven Fuchs (http://www.artweb-design.de), # Joshua Harvey (http://www.workingwithrails.com/person/759-joshua-harvey), @@ -5,10 +6,14 @@ # Stephan Soller (http://www.arkanis-development.de/) # Copyright:: Copyright (c) 2008 The Ruby i18n Team # License:: MIT -require 'i18n/backend/simple' -require 'i18n/exceptions' +#++ module I18n + autoload :ArgumentError, 'i18n/exceptions' + module Backend + autoload :Simple, 'i18n/backend/simple' + end + @@backend = nil @@load_path = nil @@default_locale = :'en' diff --git a/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb b/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb index c09acd7d2d..c32cc76f34 100644 --- a/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb +++ b/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb @@ -1,4 +1,4 @@ -require 'yaml' +require 'i18n/exceptions' module I18n module Backend @@ -186,6 +186,7 @@ module I18n # Loads a YAML translations file. The data must have locales as # toplevel keys. def load_yml(filename) + require 'yaml' unless defined? :YAML YAML::load(IO.read(filename)) end @@ -211,4 +212,4 @@ module I18n end end end -end
\ No newline at end of file +end diff --git a/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/exceptions.rb b/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/exceptions.rb index b5cea7acb4..6897055d6d 100644 --- a/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/exceptions.rb +++ b/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/exceptions.rb @@ -50,4 +50,4 @@ module I18n super "can not load translations from #{filename}, the file type #{type} is not known" end end -end
\ No newline at end of file +end |