Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Lazy load I18n

  • Loading branch information...
commit a00228c1a35578c4bf4d462eec977a50120288da 1 parent abd6f4a
@spastorino spastorino authored
View
5 actionpack/lib/action_view.rb
@@ -76,7 +76,8 @@ module ActionView
ENCODING_FLAG = '#.*coding[:=]\s*(\S+)[ \t]*'
end
-require 'active_support/i18n'
require 'active_support/core_ext/string/output_safety'
-I18n.load_path << "#{File.dirname(__FILE__)}/action_view/locale/en.yml"
+ActiveSupport.on_load(:i18n) do
+ I18n.load_path << "#{File.dirname(__FILE__)}/action_view/locale/en.yml"
+end
View
5 activemodel/lib/active_model.rb
@@ -59,5 +59,6 @@ module Serializers
end
end
-require 'active_support/i18n'
-I18n.load_path << File.dirname(__FILE__) + '/active_model/locale/en.yml'
+ActiveSupport.on_load(:i18n) do
+ I18n.load_path << File.dirname(__FILE__) + '/active_model/locale/en.yml'
+end
View
5 activerecord/lib/active_record.rb
@@ -22,7 +22,6 @@
#++
require 'active_support'
-require 'active_support/i18n'
require 'active_model'
require 'arel'
require 'active_record_deprecated_finders'
@@ -145,4 +144,6 @@ module Scoping
Arel::Table.engine = self
end
-I18n.load_path << File.dirname(__FILE__) + '/active_record/locale/en.yml'
+ActiveSupport.on_load(:i18n) do
+ I18n.load_path << File.dirname(__FILE__) + '/active_record/locale/en.yml'
+end
View
1  activesupport/lib/active_support/i18n.rb
@@ -6,4 +6,5 @@
raise e
end
+ActiveSupport.run_load_hooks(:i18n)
I18n.load_path << "#{File.dirname(__FILE__)}/locale/en.yml"
Please sign in to comment.
Something went wrong with that request. Please try again.