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:
parent
4e33d04444
commit
8ec1926aba
4 changed files with 26 additions and 9 deletions
lib/public/TextProcessing
|
@ -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');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue