Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 97998f2

Browse files
magehardikkeharper
andauthored
Update widget_prompt.md (#8283)
Co-authored-by: Kevin Harper <[email protected]>
1 parent 533bac3 commit 97998f2

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/guides/v2.3/javascript-dev-guide/widgets/widget_prompt.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The prompt widget can be initialized with or without binding to a certain elemen
2020

2121
```javascript
2222
$('#prompt_init').prompt({
23-
title: 'Prompt title',
23+
title: $.mage.__('Prompt title'),
2424
actions: {
2525
confirm: function(){}, //callback on 'Ok' button click
2626
cancel: function(){}, //callback on 'Cancel' button click
@@ -33,12 +33,13 @@ $('#prompt_init').prompt({
3333

3434
```javascript
3535
require([
36+
'jquery',
3637
'Magento_Ui/js/modal/prompt'
37-
], function(prompt) { // Variable that represents the `prompt` function
38+
], function($, prompt) { // Variable that represents the `prompt` function
3839

3940
prompt({
40-
title: 'Some title',
41-
content: 'Some content',
41+
title: $.mage.__('Some title'),
42+
content: $.mage.__('Some content'),
4243
actions: {
4344
confirm: function(){},
4445
cancel: function(){},
@@ -223,9 +224,9 @@ The prompt widget implements the following events:
223224
'use strict';
224225
225226
$('.prompt-modal-content').prompt({
226-
title: 'Prompt Title',
227+
title: $.mage.__('Prompt Title'),
227228
modalClass: 'prompt',
228-
value: 'Value by default',
229+
value: $.mage.__('Value by default'),
229230
validation: true,
230231
promptField: '[data-role="promptField"]',
231232
validationRules: ['required-entry'],
@@ -269,10 +270,10 @@ The prompt widget implements the following events:
269270
'use strict';
270271
271272
prompt({
272-
title: 'Prompt Title',
273-
content: $('.prompt-modal-content'),
273+
title: $.mage.__('Prompt Title'),
274+
content: $.mage.__($('.prompt-modal-content')),
274275
modalClass: 'prompt',
275-
value: 'Value by default',
276+
value: $.mage.__('Value by default'),
276277
validation: true,
277278
promptField: '[data-role="promptField"]',
278279
validationRules: ['required-entry'],

0 commit comments

Comments
 (0)