From 97998f2dc15c7cd9370557eb45c8032f8ebc823b Mon Sep 17 00:00:00 2001 From: Hardik Makwana Date: Sat, 19 Dec 2020 02:57:57 +0530 Subject: [PATCH] Update widget_prompt.md (#8283) Co-authored-by: Kevin Harper --- .../widgets/widget_prompt.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/guides/v2.3/javascript-dev-guide/widgets/widget_prompt.md b/src/guides/v2.3/javascript-dev-guide/widgets/widget_prompt.md index e81a43f7264..239bdc26991 100644 --- a/src/guides/v2.3/javascript-dev-guide/widgets/widget_prompt.md +++ b/src/guides/v2.3/javascript-dev-guide/widgets/widget_prompt.md @@ -20,7 +20,7 @@ The prompt widget can be initialized with or without binding to a certain elemen ```javascript $('#prompt_init').prompt({ - title: 'Prompt title', + title: $.mage.__('Prompt title'), actions: { confirm: function(){}, //callback on 'Ok' button click cancel: function(){}, //callback on 'Cancel' button click @@ -33,12 +33,13 @@ $('#prompt_init').prompt({ ```javascript require([ + 'jquery', 'Magento_Ui/js/modal/prompt' -], function(prompt) { // Variable that represents the `prompt` function +], function($, prompt) { // Variable that represents the `prompt` function prompt({ - title: 'Some title', - content: 'Some content', + title: $.mage.__('Some title'), + content: $.mage.__('Some content'), actions: { confirm: function(){}, cancel: function(){}, @@ -223,9 +224,9 @@ The prompt widget implements the following events: 'use strict'; $('.prompt-modal-content').prompt({ - title: 'Prompt Title', + title: $.mage.__('Prompt Title'), modalClass: 'prompt', - value: 'Value by default', + value: $.mage.__('Value by default'), validation: true, promptField: '[data-role="promptField"]', validationRules: ['required-entry'], @@ -269,10 +270,10 @@ The prompt widget implements the following events: 'use strict'; prompt({ - title: 'Prompt Title', - content: $('.prompt-modal-content'), + title: $.mage.__('Prompt Title'), + content: $.mage.__($('.prompt-modal-content')), modalClass: 'prompt', - value: 'Value by default', + value: $.mage.__('Value by default'), validation: true, promptField: '[data-role="promptField"]', validationRules: ['required-entry'],