From e537b5561287bc7540c9f75dc781aa83f42dadc6 Mon Sep 17 00:00:00 2001 From: "Dan Kleine (Dan Untenzu)" Date: Mon, 9 Sep 2024 12:14:35 +0200 Subject: [PATCH] [FEATURE] Make widget more compact and use severity Use severity levels in widget as well and reduce the height to prevent unused whitespace. --- Configuration/Services.php | 2 +- .../Backend/Templates/Widget/UsageWidget.html | 21 +++++++++++++------ Resources/Private/Language/de.locallang.xlf | 14 +++++-------- Resources/Private/Language/locallang.xlf | 9 +++----- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/Configuration/Services.php b/Configuration/Services.php index 44fd09b..2bc7246 100644 --- a/Configuration/Services.php +++ b/Configuration/Services.php @@ -168,7 +168,7 @@ 'title' => 'LLL:EXT:wv_deepltranslate/Resources/Private/Language/locallang.xlf:widgets.deepltranslate.widget.useswidget.title', 'description' => 'LLL:EXT:wv_deepltranslate/Resources/Private/Language/locallang.xlf:widgets.deepltranslate.widget.useswidget.description', 'iconIdentifier' => 'content-widget-list', - 'height' => 'medium', + 'height' => 'small', 'width' => 'small', ]) ; diff --git a/Resources/Private/Backend/Templates/Widget/UsageWidget.html b/Resources/Private/Backend/Templates/Widget/UsageWidget.html index 8261de5..6377efe 100644 --- a/Resources/Private/Backend/Templates/Widget/UsageWidget.html +++ b/Resources/Private/Backend/Templates/Widget/UsageWidget.html @@ -8,14 +8,23 @@

{item.label}

+ + + {item.usage.count / item.usage.limit * 100} + + + + + +

- {f:translate(key: 'LLL:EXT:wv_deepltranslate/Resources/Private/Language/locallang.xlf:widgets.deepltranslate.widget.useswidget.count')}: {item.usage.count -> f:format.number(thousandsSeparator: '.', decimalSeparator: '', decimals: 0)} -
- {f:translate(key: 'LLL:EXT:wv_deepltranslate/Resources/Private/Language/locallang.xlf:widgets.deepltranslate.widget.useswidget.limit')}: {item.usage.limit -> f:format.number(thousandsSeparator: '.', decimalSeparator: '', decimals: 0)} +

- {item.usage.count / item.usage.limit * 100}
-
{item.usage.count -> f:format.number(thousandsSeparator: '.', decimalSeparator: '', decimals: 0)}
+
 
@@ -25,4 +34,4 @@

{item.label}

- \ No newline at end of file + diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf index 929e8db..cf820dc 100644 --- a/Resources/Private/Language/de.locallang.xlf +++ b/Resources/Private/Language/de.locallang.xlf @@ -225,20 +225,16 @@ DeepL Verwendung - - + Show a DeepL usage bar + Zeige einen Fortschrittsbalken für die DeepL Nutzung Character Zeichen - - Count - Zähler - - - Limit - Begrenzung + + DeepL translations for current billing period: %s of %s characters + DeepL Übersetzungen für aktuellen Abrechnungszeitraum: %s von %s Zeichen diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index a94a734..c1cf013 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -194,16 +194,13 @@ DeepL Usage - + Show a DeepL usage bar Character - - Count - - - Limit + + DeepL translations for current billing period: %s of %s characters