From ec373f717b3c29e9cd97c217da4b4d3caa25d669 Mon Sep 17 00:00:00 2001 From: brianswko Date: Mon, 16 Nov 2020 19:45:27 -0600 Subject: [PATCH] Insert ice_cube translations before rails_i18n --- lib/ice_cube/i18n.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ice_cube/i18n.rb b/lib/ice_cube/i18n.rb index f01245c0..8eae0927 100644 --- a/lib/ice_cube/i18n.rb +++ b/lib/ice_cube/i18n.rb @@ -14,7 +14,8 @@ def self.backend end def self.detect_backend! - ::I18n.load_path += Dir[File.join(LOCALES_PATH, '*.yml')] + rails_i18n_index = ::I18n.load_path.index { |item| item =~ /rails_i18n/ } || -1 + ::I18n.load_path.insert(rails_i18n_index, *Dir[File.join(LOCALES_PATH, '*.yml')]) ::I18n rescue NameError NullI18n