Skip to content

Instantly share code, notes, and snippets.

@pinzolo
Last active December 30, 2015 16:19
Show Gist options
  • Save pinzolo/7854413 to your computer and use it in GitHub Desktop.
Save pinzolo/7854413 to your computer and use it in GitHub Desktop.
Redmine プラグインの言語ファイルが優先されるように I18n.load_path を調整する
# coding: utf-8
module RedmineApp
class Application < Rails::Application
config.after_initialize do
plugin_root_path = File.expand_path(File.join(File.dirname(__FILE__), '../'))
Dir.glob(File.join(plugin_root_path, 'config', 'locales', '*.yml')) do |path|
if I18n.load_path.include?(path)
I18n.load_path.delete(path)
I18n.load_path << path
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment