Skip to content

Commit

Permalink
MAGETWO-56919: [Backport] - [GitHub] Translate messages on password s…
Browse files Browse the repository at this point in the history
…trength #5509 #5883 #5861 - for 2.0
  • Loading branch information
zakdma committed Nov 23, 2016
1 parent 4ac2029 commit 890c328
Show file tree
Hide file tree
Showing 17 changed files with 153 additions and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
define([
'jquery',
'underscore',
'jquery/ui'
'jquery/ui',
'mage/translate'
], function ($, _) {
'use strict';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@
*/
define([
'uiComponent',
'Magento_Customer/js/customer-data'
'Magento_Customer/js/customer-data',
'mage/translate'
], function (Component, customerData) {
'use strict';

var sidebarInitialized = false;

function initSidebar() {
if (sidebarInitialized) {
return ;
return;
}
sidebarInitialized = true;
require([
'jquery',
'mage/mage'
], function ($) {
/*eslint-disable max-len*/
$('[data-role=compare-products-sidebar]').mage('compareItems', {
"removeConfirmMessage": $.mage.__(
"Are you sure you want to remove this item from your Compare Products list?"
),
"removeSelector": "#compare-items a.action.delete",
"clearAllConfirmMessage": $.mage.__(
"Are you sure you want to remove all items from your Compare Products list?"
),
"clearAllSelector": "#compare-clear-all"
'removeConfirmMessage': $.mage.__('Are you sure you want to remove this item from your Compare Products list?'),
'removeSelector': '#compare-items a.action.delete',
'clearAllConfirmMessage': $.mage.__('Are you sure you want to remove all items from your Compare Products list?'),
'clearAllSelector': '#compare-clear-all'
});

/*eslint-enable max-len*/
});
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Checkout/view/frontend/web/js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ define([
var msg = response.error_message;
if (msg) {
alert({
content: $.mage.__(msg)
content: msg
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ define([
'Magento_Customer/js/customer-data',
'jquery',
'ko',
'sidebar'
'sidebar',
'mage/translate'
], function (Component, customerData, $, ko) {
'use strict';

Expand Down Expand Up @@ -67,9 +68,7 @@ define([
'qty': ':input.cart-item-qty',
'button': ':button.update-cart-item'
},
'confirmMessage': $.mage.__(
'Are you sure you would like to remove this item from the shopping cart?'
)
'confirmMessage': $.mage.__('Are you sure you would like to remove this item from the shopping cart?')
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ require([
'jquery',
'mage/template',
'jquery/file-uploader',
'domReady!'
'domReady!',
'mage/translate'
], function ($, mageTemplate) {
$('#<?php echo $block->getHtmlId() ?> .fileupload').fileupload({
dataType: 'json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ define([
'jquery',
'Magento_Ui/js/core/app',
'underscore',
'notification'
'notification',
'mage/translate'
], function (Component, $, bootstrap, _) {
'use strict';

Expand Down Expand Up @@ -221,9 +222,7 @@ define([

if (data.items.length) {
this.productsModal.notification('add', {
message: $.mage.__(
'Choose a new product to delete and replace the current product configuration.'
),
message: $.mage.__('Choose a new product to delete and replace the current product configuration.'),
messageContainer: this.gridSelector
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ define([
this.setNotificationMessage();
},
setNotificationMessage: function () {
/*eslint-disable max-len*/
var msg = $.mage.__('When you remove or add an attribute, we automatically update all configurations and you will need to recreate current configurations manually.');

/*eslint-enable max-len*/

if (this.mode === 'edit') {
this.wizard.setNotificationMessage($.mage.__('When you remove or add an attribute, we automatically ' +
'update all configurations and you will need to manually recreate the current configurations.'));
this.wizard.setNotificationMessage(msg);
}
},
doSelectSavedAttributes: function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ require([
'mage/template',
'jquery/file-uploader',
'mage/mage',
'prototype'
'prototype',
'mage/translate'
], function(jQuery, registry, mageTemplate){
registry.get('downloadable', function (Downloadable) {
var linkTemplate = '<tr>'+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ require([
'uiRegistry',
'mage/template',
'jquery/file-uploader',
'prototype'
'prototype',
'mage/translate'
], function (jQuery, registry, mageTemplate) {
registry.get('downloadable', function (Downloadable) {
var sampleTemplate = '<tr>'+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
'Magento_Payment/js/model/credit-card-validation/credit-card-number-validator',
'Magento_Payment/js/model/credit-card-validation/expiration-date-validator/expiration-year-validator',
'Magento_Payment/js/model/credit-card-validation/expiration-date-validator/expiration-month-validator',
'Magento_Payment/js/model/credit-card-validation/credit-card-data'
'Magento_Payment/js/model/credit-card-validation/credit-card-data',
'mage/translate'
], factory);
} else {
factory(jQuery);
Expand Down Expand Up @@ -40,7 +41,7 @@
return false;
}
},
'Please enter a valid credit card type number.'
$.mage.__('Please enter a valid credit card type number.')
],
'validate-card-number': [
/**
Expand All @@ -51,7 +52,7 @@
function (number) {
return creditCardNumberValidator(number).isValid;
},
'Please enter a valid credit card number.'
$.mage.__('Please enter a valid credit card number.')
],
'validate-card-date': [
/**
Expand All @@ -62,7 +63,7 @@
function (date) {
return monthValidator(date).isValid;
},
'Incorrect credit card expiration month.'
$.mage.__('Incorrect credit card expiration month.')
],
'validate-card-cvv': [
/**
Expand All @@ -74,7 +75,7 @@
var maxLength = creditCardData.creditCard ? creditCardData.creditCard.code.size : 3;
return cvvValidator(cvv, maxLength).isValid;
},
'Please enter a valid credit card verification number.'
$.mage.__('Please enter a valid credit card verification number.')
],
'validate-card-year': [
/**
Expand All @@ -85,7 +86,7 @@
function (date) {
return monthValidator(date).isValid;
},
'Incorrect credit card expiration year.'
$.mage.__('Incorrect credit card expiration year.')
]

}, function (i, rule) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Paypal/view/frontend/web/order-review.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ define([
}
}
alert({
content: $.mage.__(msg)
content: msg
});
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
require([
'jquery',
'Magento_Ui/js/modal/alert',
'jquery/ui'
'jquery/ui',
'mage/translate'
],
function ($, alert) {
'use strict';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* See COPYING.txt for license details.
*/
require([
"jquery"
"jquery",
'mage/translate'
], function ($) {
$(function () {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ require([
'jquery',
'mage/template',
'jquery/file-uploader',
'domReady!'
'domReady!',
'mage/translate'
], function ($, mageTemplate) {

$('#fileupload').fileupload({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ define([
'jquery',
'mage/template',
'text!Magento_Ui/templates/grid/cells/thumbnail/preview.html',
'Magento_Ui/js/modal/modal'
'Magento_Ui/js/modal/modal',
'mage/translate'
], function (Column, $, mageTemplate, thumbnailPreviewTemplate) {
'use strict';

Expand Down
19 changes: 12 additions & 7 deletions app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ define([
return true;
},
function() {
return 'Please enter a value less than or equal to %s.'.replace('%s', this.lteToVal);
return $.mage.__('Please enter a value less than or equal to %s.').replace('%s', this.lteToVal);
}
],
"greater-than-equals-to": [
Expand All @@ -681,7 +681,7 @@ define([
return true;
},
function() {
return 'Please enter a value greater than or equal to %s.'.replace('%s', this.gteToVal);
return $.mage.__('Please enter a value greater than or equal to %s.').replace('%s', this.gteToVal);
}
],
"validate-emails": [
Expand All @@ -697,7 +697,8 @@ define([
}
}
return true;
}, "Please enter valid email addresses, separated by commas. For example, [email protected], [email protected]."
},
$.mage.__("Please enter valid email addresses, separated by commas. For example, [email protected], [email protected].")
],
"validate-cc-number": [
/**
Expand All @@ -710,7 +711,8 @@ define([
return validateCreditCard(value);
}
return false;
}, $.mage.__('Please enter a valid credit card number.')
},
$.mage.__('Please enter a valid credit card number.')
],
"validate-cc-ukss": [
/**
Expand All @@ -720,17 +722,20 @@ define([
*/
function(value) {
return value;
}, $.mage.__('Please enter issue number or start date for switch/solo card type.')
},
$.mage.__('Please enter issue number or start date for switch/solo card type.')
],
'required-entry': [
function(value) {
return !utils.isEmpty(value);
}, $.mage.__('This is a required field.')
},
$.mage.__('This is a required field.')
],
'checked': [
function(value) {
return value;
}, $.mage.__('This is a required field.')
},
$.mage.__('This is a required field.')
],
'not-negative-amount': [
function(value) {
Expand Down
Loading

0 comments on commit 890c328

Please sign in to comment.