mirror of
https://ghfast.top/https://github.com/discourse/discourse-translator.git
synced 2026-07-16 11:46:33 +08:00
* FEATURE: Add Azure key ProblemChecker Added a Problem checker with a "high" priority for the Azure key, so sit administrators can see the problem of missing Azure key on the dashboard in real time when the translator is configured as Microsoft. Co-authored-by: Natalie Tay <natalie.tay@gmail.com>
13 lines
345 B
Ruby
13 lines
345 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ProblemCheck::MicrosoftAzureKey < ProblemCheck
|
|
self.priority = "high"
|
|
|
|
def call
|
|
return no_problem unless SiteSetting.translator_enabled
|
|
return no_problem if SiteSetting.translator != "Microsoft"
|
|
return problem if SiteSetting.translator_azure_subscription_key.blank?
|
|
|
|
no_problem
|
|
end
|
|
end
|