Skip to content

Commit

Permalink
[FEATURE] Translate flash message title
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelbrackets committed Oct 19, 2024
1 parent d82b991 commit 7f87029
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Classes/Hooks/UsageProcessAfterFinishHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public function processCmdmap_afterFinish(DataHandler $dataHandler): void
return;
}

$label = $this->getLanguageService()->sL(
$title = $this->getLanguageService()->sL(
'LLL:EXT:wv_deepltranslate/Resources/Private/Language/locallang.xlf:usages.flashmassage.title'
);
$message = $this->getLanguageService()->sL(
'LLL:EXT:wv_deepltranslate/Resources/Private/Language/locallang.xlf:usages.flashmassage.limit.description'
);

Expand All @@ -53,8 +56,8 @@ public function processCmdmap_afterFinish(DataHandler $dataHandler): void

$flashMessage = GeneralUtility::makeInstance(
FlashMessage::class,
sprintf($label, $usage->character->count, $usage->character->limit),
'Deepl Usage',
sprintf($message, $usage->character->count, $usage->character->limit),
$title,
$severity,
true
);
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
<source>Information not available</source>
</trans-unit>
<trans-unit id="usages.flashmassage.title">
<source>DeepL Translate </source>
<source>DeepL usage and quota</source>
</trans-unit>
<trans-unit id="usages.flashmassage.limit.description">
<source>DeepL Translate Limit %s / %s</source>
Expand Down

0 comments on commit 7f87029

Please sign in to comment.