diff --git a/lib/pleroma/language/language_detector.ex b/lib/pleroma/language/language_detector.ex index 42d200a287..cba2698926 100644 --- a/lib/pleroma/language/language_detector.ex +++ b/lib/pleroma/language/language_detector.ex @@ -5,6 +5,12 @@ defmodule Pleroma.Language.LanguageDetector do @words_threshold 4 + def configured? do + provider = get_provider() + + !!provider and provider.configured? + end + def missing_dependencies do provider = get_provider() diff --git a/lib/pleroma/web/mastodon_api/views/instance_view.ex b/lib/pleroma/web/mastodon_api/views/instance_view.ex index 829688bfa9..69c4c0c376 100644 --- a/lib/pleroma/web/mastodon_api/views/instance_view.ex +++ b/lib/pleroma/web/mastodon_api/views/instance_view.ex @@ -177,6 +177,9 @@ def features do if Pleroma.Language.Translation.configured?() do "translation" end, + if Pleroma.Language.LanguageDetector.configured?() do + "language_detection" + end, "events", "multitenancy" ]