mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:42:04 +08:00
FIX: Don't load other locales in test mode
This commit is contained in:
parent
fc73de9578
commit
9e03b5c69a
|
@ -30,11 +30,13 @@ class LocaleSiteSetting < EnumSiteSetting
|
|||
File.join(Rails.root, 'config', 'locales', 'client.*.yml')
|
||||
)
|
||||
|
||||
plugin_client_files = Dir.glob(
|
||||
File.join(Rails.root, 'plugins', '*', 'config', 'locales', 'client.*.yml')
|
||||
)
|
||||
unless Rails.env.test? && ENV['LOAD_PLUGINS'] != "1"
|
||||
app_client_files += Dir.glob(
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user