Skip to content

Commit 8ec1926

Browse files
marcelklehrjulien-nc
authored andcommitted
fix(TextProcessing): Inject L10N\IFactory instead of IL10N
Signed-off-by: Marcel Klehr <[email protected]>
1 parent 4e33d04 commit 8ec1926

4 files changed

Lines changed: 26 additions & 9 deletions

File tree

lib/public/TextProcessing/FreePromptTaskType.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,25 @@
2626
namespace OCP\TextProcessing;
2727

2828
use OCP\IL10N;
29+
use OCP\L10N\IFactory;
2930

3031
/**
3132
* This is the text processing task type for free prompting
3233
* @since 27.1.0
3334
*/
3435
class FreePromptTaskType implements ITaskType {
36+
private IL10N $l;
37+
3538
/**
3639
* Constructor for FreePromptTaskType
3740
*
38-
* @param IL10N $l
41+
* @param IFactory $l10nFactory
3942
* @since 27.1.0
4043
*/
4144
public function __construct(
42-
private IL10N $l,
45+
IFactory $l10nFactory,
4346
) {
47+
$this->l = $l10nFactory->get('core');
4448
}
4549

4650

lib/public/TextProcessing/HeadlineTaskType.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,25 @@
2626
namespace OCP\TextProcessing;
2727

2828
use OCP\IL10N;
29+
use OCP\L10N\IFactory;
2930

3031
/**
3132
* This is the text processing task type for creating headline
3233
* @since 27.1.0
3334
*/
3435
class HeadlineTaskType implements ITaskType {
36+
private IL10N $l;
37+
3538
/**
3639
* Constructor for HeadlineTaskType
3740
*
38-
* @param IL10N $l
41+
* @param IFactory $l10nFactory
3942
* @since 27.1.0
4043
*/
4144
public function __construct(
42-
private IL10N $l,
45+
IFactory $l10nFactory,
4346
) {
47+
$this->l = $l10nFactory->get('core');
4448
}
4549

4650

@@ -57,6 +61,6 @@ public function getName(): string {
5761
* @since 27.1.0
5862
*/
5963
public function getDescription(): string {
60-
return $this->l->t('Generates a possible headline for a text');
64+
return $this->l->t('Generates a possible headline for a text.');
6165
}
6266
}

lib/public/TextProcessing/SummaryTaskType.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,26 @@
2626
namespace OCP\TextProcessing;
2727

2828
use OCP\IL10N;
29+
use OCP\L10N\IFactory;
2930

3031
/**
3132
* This is the text processing task type for summaries
3233
* @since 27.1.0
3334
*/
3435
class SummaryTaskType implements ITaskType {
36+
37+
private IL10N $l;
38+
3539
/**
3640
* Constructor for SummaryTaskType
3741
*
38-
* @param IL10N $l
42+
* @param IFactory $l10nFactory
3943
* @since 27.1.0
4044
*/
4145
public function __construct(
42-
private IL10N $l,
46+
IFactory $l10nFactory,
4347
) {
48+
$this->l = $l10nFactory->get('core');
4449
}
4550

4651

lib/public/TextProcessing/TopicsTaskType.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,25 @@
2626
namespace OCP\TextProcessing;
2727

2828
use OCP\IL10N;
29+
use OCP\L10N\IFactory;
2930

3031
/**
3132
* This is the text processing task type for topics extraction
3233
* @since 27.1.0
3334
*/
3435
class TopicsTaskType implements ITaskType {
36+
private IL10N $l;
37+
3538
/**
3639
* Constructor for TopicsTaskType
3740
*
38-
* @param IL10N $l
41+
* @param IFactory $l10nFactory
3942
* @since 27.1.0
4043
*/
4144
public function __construct(
42-
private IL10N $l,
45+
IFactory $l10nFactory,
4346
) {
47+
$this->l = $l10nFactory->get('core');
4448
}
4549

4650

0 commit comments

Comments
 (0)