mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Rails.logger isn't always available when loading plugin locales
This commit is contained in:
@ -591,7 +591,13 @@ JS
|
||||
DiscoursePluginRegistry.register_locale(locale, opts)
|
||||
Rails.configuration.assets.precompile << "locales/#{locale}.js"
|
||||
else
|
||||
Rails.logger.error "Invalid locale! #{opts.inspect}"
|
||||
msg = "Invalid locale! #{opts.inspect}"
|
||||
# The logger isn't always present during boot / parsing locales from plugins
|
||||
if Rails.logger.present?
|
||||
Rails.logger.error(msg)
|
||||
else
|
||||
puts msg
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user