Skip to content

Commit 890c328

Browse files
committed
MAGETWO-56919: [Backport] - [GitHub] Translate messages on password strength #5509 #5883 #5861 - for 2.0
1 parent 4ac2029 commit 890c328

File tree

17 files changed

+153
-127
lines changed

17 files changed

+153
-127
lines changed

app/code/Magento/Catalog/view/adminhtml/web/catalog/product-attributes.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
define([
66
'jquery',
77
'underscore',
8-
'jquery/ui'
8+
'jquery/ui',
9+
'mage/translate'
910
], function ($, _) {
1011
'use strict';
1112

app/code/Magento/Catalog/view/frontend/web/js/view/compare-products.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,31 @@
44
*/
55
define([
66
'uiComponent',
7-
'Magento_Customer/js/customer-data'
7+
'Magento_Customer/js/customer-data',
8+
'mage/translate'
89
], function (Component, customerData) {
910
'use strict';
1011

1112
var sidebarInitialized = false;
1213

1314
function initSidebar() {
1415
if (sidebarInitialized) {
15-
return ;
16+
return;
1617
}
1718
sidebarInitialized = true;
1819
require([
1920
'jquery',
2021
'mage/mage'
2122
], function ($) {
23+
/*eslint-disable max-len*/
2224
$('[data-role=compare-products-sidebar]').mage('compareItems', {
23-
"removeConfirmMessage": $.mage.__(
24-
"Are you sure you want to remove this item from your Compare Products list?"
25-
),
26-
"removeSelector": "#compare-items a.action.delete",
27-
"clearAllConfirmMessage": $.mage.__(
28-
"Are you sure you want to remove all items from your Compare Products list?"
29-
),
30-
"clearAllSelector": "#compare-clear-all"
25+
'removeConfirmMessage': $.mage.__('Are you sure you want to remove this item from your Compare Products list?'),
26+
'removeSelector': '#compare-items a.action.delete',
27+
'clearAllConfirmMessage': $.mage.__('Are you sure you want to remove all items from your Compare Products list?'),
28+
'clearAllSelector': '#compare-clear-all'
3129
});
30+
31+
/*eslint-enable max-len*/
3232
});
3333
}
3434

app/code/Magento/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ define([
219219
var msg = response.error_message;
220220
if (msg) {
221221
alert({
222-
content: $.mage.__(msg)
222+
content: msg
223223
});
224224
}
225225
}

app/code/Magento/Checkout/view/frontend/web/js/view/minicart.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ define([
77
'Magento_Customer/js/customer-data',
88
'jquery',
99
'ko',
10-
'sidebar'
10+
'sidebar',
11+
'mage/translate'
1112
], function (Component, customerData, $, ko) {
1213
'use strict';
1314

@@ -67,9 +68,7 @@ define([
6768
'qty': ':input.cart-item-qty',
6869
'button': ':button.update-cart-item'
6970
},
70-
'confirmMessage': $.mage.__(
71-
'Are you sure you would like to remove this item from the shopping cart?'
72-
)
71+
'confirmMessage': $.mage.__('Are you sure you would like to remove this item from the shopping cart?')
7372
});
7473
}
7574

app/code/Magento/Cms/view/adminhtml/templates/browser/content/uploader.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ require([
2929
'jquery',
3030
'mage/template',
3131
'jquery/file-uploader',
32-
'domReady!'
32+
'domReady!',
33+
'mage/translate'
3334
], function ($, mageTemplate) {
3435
$('#<?php echo $block->getHtmlId() ?> .fileupload').fileupload({
3536
dataType: 'json',

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/product-grid.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ define([
88
'jquery',
99
'Magento_Ui/js/core/app',
1010
'underscore',
11-
'notification'
11+
'notification',
12+
'mage/translate'
1213
], function (Component, $, bootstrap, _) {
1314
'use strict';
1415

@@ -221,9 +222,7 @@ define([
221222

222223
if (data.items.length) {
223224
this.productsModal.notification('add', {
224-
message: $.mage.__(
225-
'Choose a new product to delete and replace the current product configuration.'
226-
),
225+
message: $.mage.__('Choose a new product to delete and replace the current product configuration.'),
227226
messageContainer: this.gridSelector
228227
});
229228
} else {

app/code/Magento/ConfigurableProduct/view/adminhtml/web/js/variations/steps/select_attributes.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ define([
5151
this.setNotificationMessage();
5252
},
5353
setNotificationMessage: function () {
54+
/*eslint-disable max-len*/
55+
var msg = $.mage.__('When you remove or add an attribute, we automatically update all configurations and you will need to recreate current configurations manually.');
56+
57+
/*eslint-enable max-len*/
58+
5459
if (this.mode === 'edit') {
55-
this.wizard.setNotificationMessage($.mage.__('When you remove or add an attribute, we automatically ' +
56-
'update all configurations and you will need to manually recreate the current configurations.'));
60+
this.wizard.setNotificationMessage(msg);
5761
}
5862
},
5963
doSelectSavedAttributes: function () {

app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/links.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ require([
104104
'mage/template',
105105
'jquery/file-uploader',
106106
'mage/mage',
107-
'prototype'
107+
'prototype',
108+
'mage/translate'
108109
], function(jQuery, registry, mageTemplate){
109110
registry.get('downloadable', function (Downloadable) {
110111
var linkTemplate = '<tr>'+

app/code/Magento/Downloadable/view/adminhtml/templates/product/edit/downloadable/samples.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ require([
6363
'uiRegistry',
6464
'mage/template',
6565
'jquery/file-uploader',
66-
'prototype'
66+
'prototype',
67+
'mage/translate'
6768
], function (jQuery, registry, mageTemplate) {
6869
registry.get('downloadable', function (Downloadable) {
6970
var sampleTemplate = '<tr>'+

app/code/Magento/Payment/view/frontend/web/js/model/credit-card-validation/validator.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
'Magento_Payment/js/model/credit-card-validation/credit-card-number-validator',
1313
'Magento_Payment/js/model/credit-card-validation/expiration-date-validator/expiration-year-validator',
1414
'Magento_Payment/js/model/credit-card-validation/expiration-date-validator/expiration-month-validator',
15-
'Magento_Payment/js/model/credit-card-validation/credit-card-data'
15+
'Magento_Payment/js/model/credit-card-validation/credit-card-data',
16+
'mage/translate'
1617
], factory);
1718
} else {
1819
factory(jQuery);
@@ -40,7 +41,7 @@
4041
return false;
4142
}
4243
},
43-
'Please enter a valid credit card type number.'
44+
$.mage.__('Please enter a valid credit card type number.')
4445
],
4546
'validate-card-number': [
4647
/**
@@ -51,7 +52,7 @@
5152
function (number) {
5253
return creditCardNumberValidator(number).isValid;
5354
},
54-
'Please enter a valid credit card number.'
55+
$.mage.__('Please enter a valid credit card number.')
5556
],
5657
'validate-card-date': [
5758
/**
@@ -62,7 +63,7 @@
6263
function (date) {
6364
return monthValidator(date).isValid;
6465
},
65-
'Incorrect credit card expiration month.'
66+
$.mage.__('Incorrect credit card expiration month.')
6667
],
6768
'validate-card-cvv': [
6869
/**
@@ -74,7 +75,7 @@
7475
var maxLength = creditCardData.creditCard ? creditCardData.creditCard.code.size : 3;
7576
return cvvValidator(cvv, maxLength).isValid;
7677
},
77-
'Please enter a valid credit card verification number.'
78+
$.mage.__('Please enter a valid credit card verification number.')
7879
],
7980
'validate-card-year': [
8081
/**
@@ -85,7 +86,7 @@
8586
function (date) {
8687
return monthValidator(date).isValid;
8788
},
88-
'Incorrect credit card expiration year.'
89+
$.mage.__('Incorrect credit card expiration year.')
8990
]
9091

9192
}, function (i, rule) {

app/code/Magento/Paypal/view/frontend/web/order-review.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ define([
132132
}
133133
}
134134
alert({
135-
content: $.mage.__(msg)
135+
content: msg
136136
});
137137
return false;
138138
}

app/code/Magento/ProductVideo/view/adminhtml/web/js/get-video-information.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
require([
77
'jquery',
88
'Magento_Ui/js/modal/alert',
9-
'jquery/ui'
9+
'jquery/ui',
10+
'mage/translate'
1011
],
1112
function ($, alert) {
1213
'use strict';

app/code/Magento/Swatches/view/adminhtml/web/js/TypeChanger.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
* See COPYING.txt for license details.
44
*/
55
require([
6-
"jquery"
6+
"jquery",
7+
'mage/translate'
78
], function ($) {
89
$(function () {
910

app/code/Magento/Theme/view/adminhtml/templates/browser/content/uploader.phtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ require([
3333
'jquery',
3434
'mage/template',
3535
'jquery/file-uploader',
36-
'domReady!'
36+
'domReady!',
37+
'mage/translate'
3738
], function ($, mageTemplate) {
3839

3940
$('#fileupload').fileupload({

app/code/Magento/Ui/view/base/web/js/grid/columns/thumbnail.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ define([
77
'jquery',
88
'mage/template',
99
'text!Magento_Ui/templates/grid/cells/thumbnail/preview.html',
10-
'Magento_Ui/js/modal/modal'
10+
'Magento_Ui/js/modal/modal',
11+
'mage/translate'
1112
], function (Column, $, mageTemplate, thumbnailPreviewTemplate) {
1213
'use strict';
1314

app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ define([
669669
return true;
670670
},
671671
function() {
672-
return 'Please enter a value less than or equal to %s.'.replace('%s', this.lteToVal);
672+
return $.mage.__('Please enter a value less than or equal to %s.').replace('%s', this.lteToVal);
673673
}
674674
],
675675
"greater-than-equals-to": [
@@ -681,7 +681,7 @@ define([
681681
return true;
682682
},
683683
function() {
684-
return 'Please enter a value greater than or equal to %s.'.replace('%s', this.gteToVal);
684+
return $.mage.__('Please enter a value greater than or equal to %s.').replace('%s', this.gteToVal);
685685
}
686686
],
687687
"validate-emails": [
@@ -697,7 +697,8 @@ define([
697697
}
698698
}
699699
return true;
700-
}, "Please enter valid email addresses, separated by commas. For example, [email protected], [email protected]."
700+
},
701+
$.mage.__("Please enter valid email addresses, separated by commas. For example, [email protected], [email protected].")
701702
],
702703
"validate-cc-number": [
703704
/**
@@ -710,7 +711,8 @@ define([
710711
return validateCreditCard(value);
711712
}
712713
return false;
713-
}, $.mage.__('Please enter a valid credit card number.')
714+
},
715+
$.mage.__('Please enter a valid credit card number.')
714716
],
715717
"validate-cc-ukss": [
716718
/**
@@ -720,17 +722,20 @@ define([
720722
*/
721723
function(value) {
722724
return value;
723-
}, $.mage.__('Please enter issue number or start date for switch/solo card type.')
725+
},
726+
$.mage.__('Please enter issue number or start date for switch/solo card type.')
724727
],
725728
'required-entry': [
726729
function(value) {
727730
return !utils.isEmpty(value);
728-
}, $.mage.__('This is a required field.')
731+
},
732+
$.mage.__('This is a required field.')
729733
],
730734
'checked': [
731735
function(value) {
732736
return value;
733-
}, $.mage.__('This is a required field.')
737+
},
738+
$.mage.__('This is a required field.')
734739
],
735740
'not-negative-amount': [
736741
function(value) {

0 commit comments

Comments
 (0)