diff --git a/lib/ice_cube.rb b/lib/ice_cube.rb index 3c283f53..25da341b 100644 --- a/lib/ice_cube.rb +++ b/lib/ice_cube.rb @@ -1,12 +1,12 @@ require "date" require "ice_cube/deprecated" +require "ice_cube/i18n" module IceCube autoload :VERSION, "ice_cube/version" autoload :TimeUtil, "ice_cube/time_util" autoload :FlexibleHash, "ice_cube/flexible_hash" - autoload :I18n, "ice_cube/i18n" autoload :Rule, "ice_cube/rule" autoload :Schedule, "ice_cube/schedule" diff --git a/lib/ice_cube/i18n.rb b/lib/ice_cube/i18n.rb index 6f135026..44c2aaf6 100644 --- a/lib/ice_cube/i18n.rb +++ b/lib/ice_cube/i18n.rb @@ -17,10 +17,12 @@ def self.backend end def self.detect_backend! - ::I18n.load_path += Dir[File.join(LOCALES_PATH, "*.yml")] ::I18n rescue NameError NullI18n end end end + +# Load the translations early in order not to override the user’s translations. +::I18n.load_path += Dir[File.join(IceCube::I18n::LOCALES_PATH, "*.yml")] if defined? I18n