]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(TextProcessing): Inject L10N\IFactory instead of IL10N
authorMarcel Klehr <mklehr@gmx.net>
Mon, 24 Jul 2023 12:07:34 +0000 (14:07 +0200)
committerMarcel Klehr <mklehr@gmx.net>
Wed, 9 Aug 2023 08:22:32 +0000 (10:22 +0200)
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
(cherry picked from commit 8ec1926aba549eeaea872d7dd2fcb69592b3a3bc)

lib/public/TextProcessing/FreePromptTaskType.php
lib/public/TextProcessing/HeadlineTaskType.php
lib/public/TextProcessing/SummaryTaskType.php
lib/public/TextProcessing/TopicsTaskType.php

index dcc27df77c9b805b5fe3d7e0579487c54f6cd578..a1e52e268a37c22683cfc4165fb5f6731e93a2d3 100644 (file)
@@ -26,21 +26,25 @@ declare(strict_types=1);
 namespace OCP\TextProcessing;
 
 use OCP\IL10N;
+use OCP\L10N\IFactory;
 
 /**
  * This is the text processing task type for free prompting
  * @since 27.1.0
  */
 class FreePromptTaskType implements ITaskType {
+       private IL10N $l;
+
        /**
         * Constructor for FreePromptTaskType
         *
-        * @param IL10N $l
+        * @param IFactory $l10nFactory
         * @since 27.1.0
         */
        public function __construct(
-               private IL10N $l,
+               IFactory $l10nFactory,
        ) {
+               $this->l = $l10nFactory->get('core');
        }
 
 
index ad38848ea87cbcbc59584cd042f5ef3f634d6d03..7061ca1d69bb728b7323674c6e9756c329fc622b 100644 (file)
@@ -26,21 +26,25 @@ declare(strict_types=1);
 namespace OCP\TextProcessing;
 
 use OCP\IL10N;
+use OCP\L10N\IFactory;
 
 /**
  * This is the text processing task type for creating headline
  * @since 27.1.0
  */
 class HeadlineTaskType implements ITaskType {
+       private IL10N $l;
+
        /**
         * Constructor for HeadlineTaskType
         *
-        * @param IL10N $l
+        * @param IFactory $l10nFactory
         * @since 27.1.0
         */
        public function __construct(
-               private IL10N $l,
+               IFactory $l10nFactory,
        ) {
+               $this->l = $l10nFactory->get('core');
        }
 
 
@@ -57,6 +61,6 @@ class HeadlineTaskType implements ITaskType {
         * @since 27.1.0
         */
        public function getDescription(): string {
-               return $this->l->t('Generates a possible headline for a text');
+               return $this->l->t('Generates a possible headline for a text.');
        }
 }
index 3d80cee47f8a3858f53f0a67276faa30b71d16f5..03e4b5b8ecea8aa821904e1ffab11e35e90e2278 100644 (file)
@@ -26,21 +26,26 @@ declare(strict_types=1);
 namespace OCP\TextProcessing;
 
 use OCP\IL10N;
+use OCP\L10N\IFactory;
 
 /**
  * This is the text processing task type for summaries
  * @since 27.1.0
  */
 class SummaryTaskType implements ITaskType {
+
+       private IL10N $l;
+
        /**
         * Constructor for SummaryTaskType
         *
-        * @param IL10N $l
+        * @param IFactory $l10nFactory
         * @since 27.1.0
         */
        public function __construct(
-               private IL10N $l,
+               IFactory $l10nFactory,
        ) {
+               $this->l = $l10nFactory->get('core');
        }
 
 
index 6162b9a13e98fdb00478851fce4e8f7e1e6dd293..5a994a7a8d21e2a0e39f0dc802ae50f6c00a1039 100644 (file)
@@ -26,21 +26,25 @@ declare(strict_types=1);
 namespace OCP\TextProcessing;
 
 use OCP\IL10N;
+use OCP\L10N\IFactory;
 
 /**
  * This is the text processing task type for topics extraction
  * @since 27.1.0
  */
 class TopicsTaskType implements ITaskType {
+       private IL10N $l;
+
        /**
         * Constructor for TopicsTaskType
         *
-        * @param IL10N $l
+        * @param IFactory $l10nFactory
         * @since 27.1.0
         */
        public function __construct(
-               private IL10N $l,
+               IFactory $l10nFactory,
        ) {
+               $this->l = $l10nFactory->get('core');
        }