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

Commit f1459ad

Browse files
authored
Add __('<your_string>') method in Alert Widget
For Alert widget, Add __('<your_string>') method in Example because this method is used for translation of the string.
1 parent 7e8f1b8 commit f1459ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

guides/v2.1/javascript-dev-guide/widgets/widget_alert.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ The alert widget can be initialized with or without binding to a certain element
1919

2020
```javascript
2121
$('#init_element').alert({
22-
title: 'Warning',
23-
content: 'Warning content',
22+
title: $.mage.__('Warning'),
23+
content: $.mage.__('Warning content'),
2424
actions: {
2525
always: function(){}
2626
}
@@ -34,8 +34,8 @@ require([
3434
], function(alert) { // Variable that represents the `alert` function
3535

3636
alert({
37-
title: 'Some title',
38-
content: 'Some content',
37+
title: $.mage.__('Some title'),
38+
content: $.mage.__('Some content'),
3939
actions: {
4040
always: function(){}
4141
}

0 commit comments

Comments
 (0)