Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix I18n.load_path ordering conflicts with rails_i18n #489

Closed
3 changes: 2 additions & 1 deletion lib/ice_cube/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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
Expand Down
Loading