Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Autoload I18n simple backend

  • Loading branch information...
commit 4f63e848433f16652f3776e814316ce1891bd0ff 1 parent f40eb52
@jeremy jeremy authored
View
9 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'
View
5 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 @@ def load_rb(filename)
# 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 @@ def deep_symbolize_keys(hash)
end
end
end
-end
+end
View
2  activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/exceptions.rb
@@ -50,4 +50,4 @@ def initialize(type, filename)
super "can not load translations from #{filename}, the file type #{type} is not known"
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.