From b682ed7ad91f15383d8acb3a8defe87b32666465 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Fri, 19 Jul 2024 10:14:06 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B07410=20-=20Change=20acknowledge=20button?= =?UTF-8?q?=20label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dictionaries/fr.dictionary.itop.ui.php | 1 - .../cs.dictionary.itop.welcome-popup.php | 3 ++- .../da.dictionary.itop.welcome-popup.php | 3 ++- .../de.dictionary.itop.welcome-popup.php | 3 ++- .../en.dictionary.itop.welcome-popup.php | 3 ++- .../es_cr.dictionary.itop.welcome-popup.php | 3 ++- .../fr.dictionary.itop.welcome-popup.php | 3 ++- .../hu.dictionary.itop.welcome-popup.php | 3 ++- .../it.dictionary.itop.welcome-popup.php | 3 ++- .../ja.dictionary.itop.welcome-popup.php | 3 ++- .../nl.dictionary.itop.welcome-popup.php | 3 ++- .../pl.dictionary.itop.welcome-popup.php | 3 ++- .../pt_br.dictionary.itop.welcome-popup.php | 3 ++- .../ru.dictionary.itop.welcome-popup.php | 3 ++- .../sk.dictionary.itop.welcome-popup.php | 3 ++- .../tr.dictionary.itop.welcome-popup.php | 3 ++- .../zh_cn.dictionary.itop.welcome-popup.php | 3 ++- .../welcome-popup/layout.ready.js.twig | 25 ++++++++++++++----- 18 files changed, 51 insertions(+), 23 deletions(-) diff --git a/dictionaries/fr.dictionary.itop.ui.php b/dictionaries/fr.dictionary.itop.ui.php index 4dda032ef..9d571c6f5 100644 --- a/dictionaries/fr.dictionary.itop.ui.php +++ b/dictionaries/fr.dictionary.itop.ui.php @@ -1466,7 +1466,6 @@ Nous espérons que vous aimerez cette version autant que nous avons eu du plaisi
Configurez vos préférences '.ITOP_APPLICATION.' pour une expérience personnalisée.
', 'UI:WelcomeMenu:Title' => 'Bienvenue dans '.ITOP_APPLICATION_SHORT, - 'UI:WelcomePopup:Button:Acknowledge' => 'Ok, supprimer ce message', 'UI:WelcomeToITop' => 'Bienvenue dans '.ITOP_APPLICATION_SHORT, 'UI:Wizard:FinalStepTitle' => 'Dernière étape: confirmation', 'UI:YourSearch' => 'Votre recherche', diff --git a/dictionaries/ui/application/welcome-popup/cs.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/cs.dictionary.itop.welcome-popup.php index 2e099ffbd..bd36dd5aa 100644 --- a/dictionaries/ui/application/welcome-popup/cs.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/cs.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('CS CZ', 'Czech', 'Čeština', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/da.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/da.dictionary.itop.welcome-popup.php index 26634e7c1..6f5a07401 100644 --- a/dictionaries/ui/application/welcome-popup/da.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/da.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('DA DA', 'Danish', 'Dansk', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/de.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/de.dictionary.itop.welcome-popup.php index bea1431e0..b2b270e40 100644 --- a/dictionaries/ui/application/welcome-popup/de.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/de.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('DE DE', 'German', 'Deutsch', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Verstanden', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Nächste', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Schließen', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/en.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/en.dictionary.itop.welcome-popup.php index 5a9f6cf85..166e71689 100644 --- a/dictionaries/ui/application/welcome-popup/en.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/en.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('EN US', 'English', 'English', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/es_cr.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/es_cr.dictionary.itop.welcome-popup.php index b8e2bba48..bd2cd3289 100644 --- a/dictionaries/ui/application/welcome-popup/es_cr.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/es_cr.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('ES CR', 'Spanish', 'Español, Castellano', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/fr.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/fr.dictionary.itop.welcome-popup.php index b9a096d03..019866158 100644 --- a/dictionaries/ui/application/welcome-popup/fr.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/fr.dictionary.itop.welcome-popup.php @@ -10,7 +10,8 @@ * */ Dict::Add('FR FR', 'French', 'Français', [ - 'UI:WelcomePopup:Button:Acknowledge' => 'Compris', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Suivant', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Fermer', 'UI:WelcomePopup:Button:RemindLater' => 'Me le rappeler plus tard', 'UI:WelcomePopup:Message:320_01_Welcome:Title' => 'Bienvenue sur ' . ITOP_APPLICATION_SHORT . ' 3.2', 'UI:WelcomePopup:Message:320_01_Welcome:Description' => '
Félicitations, vous avez atterri sur '.ITOP_APPLICATION.' '.ITOP_VERSION_NAME.' !
diff --git a/dictionaries/ui/application/welcome-popup/hu.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/hu.dictionary.itop.welcome-popup.php index b9556e895..49303de2a 100644 --- a/dictionaries/ui/application/welcome-popup/hu.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/hu.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('HU HU', 'Hungarian', 'Magyar', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/it.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/it.dictionary.itop.welcome-popup.php index 647888556..8e1419eb5 100644 --- a/dictionaries/ui/application/welcome-popup/it.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/it.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('IT IT', 'Italian', 'Italiano', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/ja.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/ja.dictionary.itop.welcome-popup.php index a86827520..d09b84b71 100644 --- a/dictionaries/ui/application/welcome-popup/ja.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/ja.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('JA JP', 'Japanese', '日本語', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/nl.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/nl.dictionary.itop.welcome-popup.php index 8cbc0ad3c..ace7d183e 100644 --- a/dictionaries/ui/application/welcome-popup/nl.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/nl.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('NL NL', 'Dutch', 'Nederlands', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/pl.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/pl.dictionary.itop.welcome-popup.php index d60bf26f6..f41b16410 100644 --- a/dictionaries/ui/application/welcome-popup/pl.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/pl.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('PL PL', 'Polish', 'Polski', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/pt_br.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/pt_br.dictionary.itop.welcome-popup.php index c428caef3..3d69737a0 100644 --- a/dictionaries/ui/application/welcome-popup/pt_br.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/pt_br.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('PT BR', 'Brazilian', 'Brazilian', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/ru.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/ru.dictionary.itop.welcome-popup.php index 7ec956bfd..89548d730 100644 --- a/dictionaries/ui/application/welcome-popup/ru.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/ru.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('RU RU', 'Russian', 'Русский', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/sk.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/sk.dictionary.itop.welcome-popup.php index e59bfa1f3..355891837 100644 --- a/dictionaries/ui/application/welcome-popup/sk.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/sk.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('SK SK', 'Slovak', 'Slovenčina', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/tr.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/tr.dictionary.itop.welcome-popup.php index 96577f829..d5e453140 100644 --- a/dictionaries/ui/application/welcome-popup/tr.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/tr.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('TR TR', 'Turkish', 'Türkçe', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/dictionaries/ui/application/welcome-popup/zh_cn.dictionary.itop.welcome-popup.php b/dictionaries/ui/application/welcome-popup/zh_cn.dictionary.itop.welcome-popup.php index d2001f84a..6fe0d045d 100644 --- a/dictionaries/ui/application/welcome-popup/zh_cn.dictionary.itop.welcome-popup.php +++ b/dictionaries/ui/application/welcome-popup/zh_cn.dictionary.itop.welcome-popup.php @@ -7,7 +7,8 @@ // UI elements Dict::Add('ZH CN', 'Chinese', '简体中文', [ 'UI:WelcomePopup:Button:RemindLater' => 'Remind me later~~', - 'UI:WelcomePopup:Button:Acknowledge' => 'Got it~~', + 'UI:WelcomePopup:Button:AcknowledgeAndNext' => 'Next~~', + 'UI:WelcomePopup:Button:AcknowledgeAndClose' => 'Close~~', ]); // Message diff --git a/templates/application/welcome-popup/layout.ready.js.twig b/templates/application/welcome-popup/layout.ready.js.twig index 49ccd756c..b2a145879 100644 --- a/templates/application/welcome-popup/layout.ready.js.twig +++ b/templates/application/welcome-popup/layout.ready.js.twig @@ -12,21 +12,28 @@ oWelcomePopupDialogElem.dialog({ title: oWelcomePopupDialogElem.attr('data-title'), open: function () { // Focus on acknowledge button - oWelcomePopupDialogElem.closest('[role="dialog"]').find('.ui-dialog-buttonset .ibo-is-primary:first').trigger('focus'); + const oAckButton = oWelcomePopupDialogElem.closest('[role="dialog"]').find('.ui-dialog-buttonset .ibo-is-primary:first'); + oAckButton.trigger('focus'); + + // Count stack items and change button label to close if there is only one + // Note: "<=" so it works when stack isn't displayed as well as when it contains only one item + if (oWelcomePopupDialogElem.find('[data-role="ibo-welcome-popup--stack-item"]').length <= 1) { + oAckButton.text({{ 'UI:WelcomePopup:Button:AcknowledgeAndClose'|dict_s|json_encode|raw }}); + } }, close: function() { oWelcomePopupDialogElem.remove(); }, buttons: [ { - text: "Remind me later", + text: {{ 'UI:WelcomePopup:Button:RemindLater'|dict_s|json_encode|raw }}, class: 'ibo-is-alternative', click: function() { oWelcomePopupDialogElem.dialog( "close" ); } }, { - text: "Got it", + text: {{ 'UI:WelcomePopup:Button:AcknowledgeAndNext'|dict_s|json_encode|raw }}, class: 'ibo-is-regular ibo-is-primary', click: function() { oWelcomePopupDialogElem.trigger('acknowledge_message.itop.welcome_popup'); @@ -68,9 +75,15 @@ oWelcomePopupDialogElem oWelcomePopupDialogElem.find('[data-role="ibo-welcome-popup--stack-item"][data-uuid="' + sUUIDEscapedForSelector + '"]').addClass('ibo-is-acknowledged'); // Display next message if any - const oNextStackItemelem = oWelcomePopupDialogElem.find('[data-role="ibo-welcome-popup--stack-item"]:not(.ibo-is-acknowledged):first'); - if (oNextStackItemelem.length > 0) { - oNextStackItemelem.trigger('click'); + const oNextStackItemElem = oWelcomePopupDialogElem.find('[data-role="ibo-welcome-popup--stack-item"]:not(.ibo-is-acknowledged):first'); + if (oNextStackItemElem.length > 0) { + oNextStackItemElem.trigger('click'); + + // Count non acknowledged stack items and change button label to close if there is only one + if (oWelcomePopupDialogElem.find('[data-role="ibo-welcome-popup--stack-item"]:not(.ibo-is-acknowledged)').length === 1) { + const oAckButton = oWelcomePopupDialogElem.closest('[role="dialog"]').find('.ui-dialog-buttonset .ibo-is-primary:first'); + oAckButton.text({{ 'UI:WelcomePopup:Button:AcknowledgeAndClose'|dict_s|json_encode|raw }}); + } } else { // Close dialog oWelcomePopupDialogElem.dialog('close');