0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-03-12 23:47:25 +00:00

fix(TextProcessing): Inject L10N\IFactory instead of IL10N

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2023-07-24 14:07:34 +02:00 committed by Julien Veyssier
parent 4e33d04444
commit 8ec1926aba
No known key found for this signature in database
GPG key ID: 4141FEE162030638
4 changed files with 26 additions and 9 deletions

View 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');
}

View 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.');
}
}

View 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');
}

View 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');
}