Skip to content

Commit 9d3c87a

Browse files
committed
MAGETWO-44049: [GITHUB] data-bind i18n expressions with JavaScript function calls are used in the core but untranslatable due to regular expression and architectural limitations #1905
- decomposed expressions in data-bind "i18n" - replaced data-bind "i18n" with "text" for variables, method invokes, expressions - removed $t() for variables and expressions
1 parent e0a56a7 commit 9d3c87a

File tree

25 files changed

+93
-92
lines changed

25 files changed

+93
-92
lines changed

app/code/Magento/Checkout/view/frontend/web/template/cart/totals/grand-total.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
-->
77
<tr class="grand totals">
88
<th class="mark" colspan="1" scope="row">
9-
<strong data-bind="text: $t(title)"></strong>
9+
<strong data-bind="text: title"></strong>
1010
</th>
1111
<td class="amount" data-th="Order Total">
1212
<strong><span class="price" data-bind="text: getValue()"></span></strong>

app/code/Magento/Checkout/view/frontend/web/template/cart/totals/shipping.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
-->
77
<!-- ko if: isCalculated() -->
88
<tr class="totals shipping excl">
9-
<th class="mark" colspan="1" scope="row" data-bind="text: $t(title) + ' (' + $t(getShippingMethodTitle()) + ')'"></th>
9+
<th class="mark" colspan="1" scope="row" data-bind="text: title + ' (' + getShippingMethodTitle() + ')'"></th>
1010
<td class="amount">
1111
<span class="price" data-bind="text: getValue()"></span>
1212
</td>

app/code/Magento/Checkout/view/frontend/web/template/cart/totals/subtotal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
-->
77
<tr class="totals sub">
8-
<th class="mark" colspan="1" scope="row" data-bind="text: $t(title)"></th>
8+
<th class="mark" colspan="1" scope="row" data-bind="text: title"></th>
99
<td class="amount" data-th="Subtotal">
1010
<span class="price" data-bind="text: getValue()"></span>
1111
</td>

app/code/Magento/Checkout/view/frontend/web/template/estimation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="opc-estimated-wrapper" data-bind="blockLoader: isLoading">
88
<div class="estimated-block">
99
<span class="estimated-label" data-bind="i18n: 'Estimated Total'"></span>
10-
<span class="estimated-price" data-bind="i18n: getValue()"></span>
10+
<span class="estimated-price" data-bind="text: getValue()"></span>
1111
</div>
1212
<div class="minicart-wrapper">
1313
<button type="button" class="action showcart" data-bind="click: showSidebar" data-toggle="opc-summary">

app/code/Magento/Checkout/view/frontend/web/template/payment.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
-->
77
<li id="payment" role="presentation" class="checkout-payment-method" data-bind="fadeVisible: isVisible">
8-
<div class="step-title" data-bind="i18n: title" data-role="title"></div>
8+
<div class="step-title" data-bind="text: title" data-role="title"></div>
99
<div id="checkout-step-payment"
1010
class="step-content"
1111
data-role="content"

app/code/Magento/Checkout/view/frontend/web/template/progress-bar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ul class="opc-progress-bar">
88
<!-- ko foreach: { data: steps().sort(sortItems), as: 'item' } -->
99
<li class="opc-progress-bar-item" data-bind="css: item.isVisible() ? '_active' : ($parent.isProcessed(item) ? '_complete' : '')">
10-
<span data-bind="i18n: item.title, click: $parent.navigateTo"></span>
10+
<span data-bind="text: item.title, click: $parent.navigateTo"></span>
1111
</li>
1212
<!-- /ko -->
1313
</ul>

app/code/Magento/Checkout/view/frontend/web/template/shipping-information.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</button>
2929
</div>
3030
<div class="shipping-information-content">
31-
<span class="value" data-bind="i18n: getShippingMethodTitle()"></span>
31+
<span class="value" data-bind="text: getShippingMethodTitle()"></span>
3232
</div>
3333
</div>
3434
</div>

app/code/Magento/Checkout/view/frontend/web/template/shipping.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@
112112
</td>
113113

114114
<td class="col col-method"
115-
data-bind="i18n: method.method_title, attr: {'id': 'label_method_' + method.method_code + '_' + method.carrier_code}"></td>
115+
data-bind="text: method.method_title, attr: {'id': 'label_method_' + method.method_code + '_' + method.carrier_code}"></td>
116116

117117
<td class="col col-carrier"
118-
data-bind="i18n: method.carrier_title, attr: {'id': 'label_carrier_' + method.method_code + '_' + method.carrier_code}"></td>
118+
data-bind="text: method.carrier_title, attr: {'id': 'label_carrier_' + method.method_code + '_' + method.carrier_code}"></td>
119119
</tr>
120120

121121
<!-- ko if: method.error_message -->
@@ -143,7 +143,7 @@
143143
</div>
144144
<!-- ko if: errorValidationMessage().length > 0 -->
145145
<div class="message notice">
146-
<span><!-- ko i18n: errorValidationMessage()--><!-- /ko --></span>
146+
<span><!-- ko text: errorValidationMessage()--><!-- /ko --></span>
147147
</div>
148148
<!-- /ko -->
149149
<div class="actions-toolbar" id="shipping-method-buttons-container">

app/code/Magento/Checkout/view/frontend/web/template/summary/grand-total.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
-->
77
<!-- ko if: isDisplayed() -->
88
<tr>
9-
<td colspan="2" data-bind="i18n: title"></td>
9+
<td colspan="2" data-bind="text: title"></td>
1010
<td class="col grandtotal">
11-
<span data-bind ="text: getValue(), attr:{'data-label': $t(title)}"></span>
11+
<span data-bind ="text: getValue(), attr:{'data-label': title}"></span>
1212
<!-- ko foreach: elems() -->
1313
<!-- ko template: getTemplate() --><!-- /ko -->
1414
<!-- /ko -->

app/code/Magento/Checkout/view/frontend/web/template/summary/item/details.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<div class="product-item-inner">
1414
<div class="product-item-name-block">
15-
<strong class="product-item-name" data-bind="i18n: $parent.name"></strong>
15+
<strong class="product-item-name" data-bind="text: $parent.name"></strong>
1616
<div class="details-qty">
1717
<span class="label"><!-- ko i18n: 'Qty' --><!-- /ko --></span>
1818
<span class="value" data-bind="text: $parent.qty"></span>
@@ -30,7 +30,7 @@
3030
<strong class="subtitle"><!-- ko i18n: 'Options Details' --><!-- /ko --></strong>
3131
<dl class="item-options">
3232
<!--ko foreach: JSON.parse($parent.options)-->
33-
<dt class="label" data-bind="i18n: label"></dt>
33+
<dt class="label" data-bind="text: label"></dt>
3434
<!-- ko if: ($data.full_view)-->
3535
<dd class="values" data-bind="html: full_view"></dd>
3636
<!-- /ko -->

0 commit comments

Comments
 (0)