FIX: Don't load other locales in test mode

This commit is contained in:
Robin Ward 2017-11-15 12:50:20 -05:00
parent fc73de9578
commit 9e03b5c69a

View File

@ -30,11 +30,13 @@ class LocaleSiteSetting < EnumSiteSetting
File.join(Rails.root, 'config', 'locales', 'client.*.yml') File.join(Rails.root, 'config', 'locales', 'client.*.yml')
) )
plugin_client_files = Dir.glob( unless Rails.env.test? && ENV['LOAD_PLUGINS'] != "1"
app_client_files += Dir.glob(
File.join(Rails.root, 'plugins', '*', 'config', 'locales', 'client.*.yml') File.join(Rails.root, 'plugins', '*', 'config', 'locales', 'client.*.yml')
) )
end
(app_client_files + plugin_client_files).map { |x| x.split('.')[-2] }.uniq.sort app_client_files.map { |x| x.split('.')[-2] }.uniq.sort
end end
end end
end end