Last active
December 30, 2015 16:19
-
-
Save pinzolo/7854413 to your computer and use it in GitHub Desktop.
Redmine プラグインの言語ファイルが優先されるように I18n.load_path を調整する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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