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

Add __('<your_string>') method in Prompt widget #8283

Merged
merged 2 commits into from
Dec 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/guides/v2.3/javascript-dev-guide/widgets/widget_prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(){},
Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -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'],
Expand Down