From 1fd0c2979e1edfb667cbb0e7abbc3c342f7d11f6 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 9 Jan 2024 10:36:52 +0100 Subject: enh(OCP\Translation): Add ITranslationProviderWithId Signed-off-by: Marcel Klehr --- apps/settings/lib/Settings/Admin/ArtificialIntelligence.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apps/settings/lib') diff --git a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php index e2862139e49..ab0dc1446bb 100644 --- a/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php +++ b/apps/settings/lib/Settings/Admin/ArtificialIntelligence.php @@ -37,6 +37,7 @@ use OCP\TextProcessing\IProvider; use OCP\TextProcessing\IProviderWithId; use OCP\TextProcessing\ITaskType; use OCP\Translation\ITranslationManager; +use OCP\Translation\ITranslationProviderWithId; use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; use Psr\Container\NotFoundExceptionInterface; @@ -62,7 +63,7 @@ class ArtificialIntelligence implements IDelegatedSettings { $translationPreferences = []; foreach ($this->translationManager->getProviders() as $provider) { $translationProviders[] = [ - 'class' => $provider::class, + 'class' => $provider instanceof ITranslationProviderWithId ? $provider->getId() : $provider::class, 'name' => $provider->getName(), ]; $translationPreferences[] = $provider::class; -- cgit v1.2.3