Change “Translate” button to only show up when a translation backend is configured (#19434)
* Change “Translate” button to only show up when a translation backend is configured Fixes #19346 * Add `translation` attribute to /api/v2/instance to expose whether the translation feature is enabled Fixes #19328
This commit is contained in:
parent
dd76bbf8b7
commit
8046cf34d6
5 changed files with 13 additions and 2 deletions
|
@ -17,6 +17,10 @@ class TranslationService
|
|||
end
|
||||
end
|
||||
|
||||
def self.configured?
|
||||
ENV['DEEPL_API_KEY'].present? || ENV['LIBRE_TRANSLATE_ENDPOINT'].present?
|
||||
end
|
||||
|
||||
def translate(_text, _source_language, _target_language)
|
||||
raise NotImplementedError
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue