Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit e67deac

Browse files
committed
Changes translations of x of y to use dynamic numbers.
- also fixes numbering in onboarding - Closes #1795
1 parent 8a19a9b commit e67deac

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

js/languages/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"Close": "Close",
1919
"Yes": "Yes",
2020
"No": "No",
21-
"of": "of",
21+
"pageXofY": "%{currentPage} of %{totalPages}",
2222
"New": "New",
2323
"Retry": "Retry",
2424
"HighlightToStyle": "Highlight text to style",

js/templates/onboardingModal.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="accordion-child accordion-active custCol-primary">
88
<div class="bar barTxt h6 custCol-secondary custCol-text">
99
<%= polyglot.t('onboarding.chooseLanguage') %>
10-
<span class="textOpacity75 fontSize14 floatRight">1 <%= polyglot.t('of') %> 10</span>
10+
<span class="textOpacity75 fontSize14 floatRight"><%= polyglot.t('pageXofY', {currentPage: 1, totalPages: 9}) %></span>
1111
</div>
1212
<div class="flexContainer" id="homeModal-languageList">
1313
<div class="flexRow">
@@ -28,7 +28,7 @@
2828
<div class="accordion-child accordion-inactive custCol-primary">
2929
<div class="bar barTxt h6 custCol-secondary custCol-text">
3030
<%= polyglot.t('onboarding.Introduction') %>
31-
<span class="textOpacity75 fontSize14 floatRight">2 <%= polyglot.t('of') %> 10</span>
31+
<span class="textOpacity75 fontSize14 floatRight"><%= polyglot.t('pageXofY', {currentPage: 2, totalPages: 9}) %></span>
3232
</div>
3333
<div class="flexContainer homeModal-settings homeModal-settings-noSearch custCol-primary">
3434
<div class="flexRow flexRow-center positionWrapper">
@@ -52,7 +52,7 @@
5252
<div class="accordion-child accordion-inactive custCol-primary">
5353
<div class="bar barTxt h6 custCol-secondary custCol-text">
5454
<%= polyglot.t('onboarding.yourCountry') %>
55-
<span class="textOpacity75 fontSize14 floatRight">3 <%= polyglot.t('of') %> 10</span>
55+
<span class="textOpacity75 fontSize14 floatRight"><%= polyglot.t('pageXofY', {currentPage: 3, totalPages: 9}) %></span>
5656
</div>
5757
<div class="flexContainer custCol-primary" id="homeModal-countryList">
5858
<div class="flexRow">
@@ -76,7 +76,7 @@
7676
<div class="accordion-child accordion-inactive custCol-primary">
7777
<div class="bar barTxt h6 custCol-secondary custCol-text">
7878
<%= polyglot.t('onboarding.localCurrency') %>
79-
<span class="textOpacity75 fontSize14 floatRight">4 <%= polyglot.t('of') %> 10</span>
79+
<span class="textOpacity75 fontSize14 floatRight"><%= polyglot.t('pageXofY', {currentPage: 4, totalPages: 9}) %></span>
8080
</div>
8181
<div class="flexContainer" id="homeModal-currencyList">
8282
<div class="flexRow">
@@ -100,7 +100,7 @@
100100
<div class="accordion-child accordion-inactive custCol-primary">
101101
<div class="bar barTxt h6 custCol-secondary custCol-text">
102102
<%= polyglot.t('onboarding.yourDetails') %> (<%= polyglot.t('Optional') %>)
103-
<span class="textOpacity75 fontSize14 floatRight">6 <%= polyglot.t('of') %> 10</span>
103+
<span class="textOpacity75 fontSize14 floatRight"><%= polyglot.t('pageXofY', {currentPage: 5, totalPages: 9}) %></span>
104104
</div>
105105
<div class="flexContainer flex-border homeModal-settings homeModal-settings-noSearch custCol-primary custCol-text">
106106
<div class="flexRow">
@@ -170,7 +170,7 @@
170170
<div class="accordion-child accordion-inactive custCol-primary">
171171
<div class="bar barTxt h6 custCol-secondary custCol-text">
172172
<%= polyglot.t('Theme') %>
173-
<span class="textOpacity75 fontSize14 floatRight">7 <%= polyglot.t('of') %> 10</span>
173+
<span class="textOpacity75 fontSize14 floatRight"><%= polyglot.t('pageXofY', {currentPage: 6, totalPages: 9}) %></span>
174174
</div>
175175
<div class="flexContainer homeModal-settings homeModal-settings-noSearch custCol-primary customThemeScrollbar">
176176
<div class="flexRow">
@@ -304,7 +304,7 @@
304304
<div class="accordion-child accordion-inactive custCol-primary">
305305
<div class="bar barTxt h6 custCol-secondary custCol-text">
306306
<%= polyglot.t('onboarding.avatar') %> (<%= polyglot.t('Optional') %>)
307-
<span class="textOpacity75 fontSize14 floatRight">8 <%= polyglot.t('of') %> 10</span>
307+
<span class="textOpacity75 fontSize14 floatRight"><%= polyglot.t('pageXofY', {currentPage: 7, totalPages: 9}) %></span>
308308
</div>
309309
<div class="flexContainer homeModal-settings homeModal-settings-noSearch custCol-primary">
310310
<div class="flexRow flexRow-center positionWrapper">
@@ -336,7 +336,7 @@
336336
<div class="accordion-child accordion-inactive custCol-primary js-followHandles">
337337
<div class="bar barTxt h6 custCol-secondary custCol-text">
338338
<%= polyglot.t('onboarding.recommended') %> (<%= polyglot.t('Optional') %>)
339-
<span class="textOpacity75 fontSize14 floatRight">9 <%= polyglot.t('of') %> 10</span>
339+
<span class="textOpacity75 fontSize14 floatRight"><%= polyglot.t('pageXofY', {currentPage: 8, totalPages: 9}) %></span>
340340
</div>
341341
<div class="flexContainer homeModal-settings homeModal-settings-noSearch custCol-primary customThemeScrollbar">
342342
<div class="flexRow">
@@ -424,7 +424,7 @@
424424
<div class="accordion-child accordion-inactive custCol-primary">
425425
<div class="bar barTxt h6 custCol-secondary custCol-text">
426426
<%= polyglot.t('onboarding.disclaimer_title') %>
427-
<span class="textOpacity75 fontSize14 floatRight">10 <%= polyglot.t('of') %> 10</span>
427+
<span class="textOpacity75 fontSize14 floatRight"><%= polyglot.t('pageXofY', {currentPage: 9, totalPages: 9}) %></span>
428428
</div>
429429
<div class="flexContainer homeModal-settings customThemeScrollbar homeModal-settings-noSearch custCol-primary">
430430
<div class="flexRow">

js/templates/storeWizard.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div class="accordion-child accordion-active">
66
<div class="bar barTxt h6 paddingLeft15 custCol-secondary custCol-text">
77
<%= polyglot.t('CreateStore') %>
8-
<span class="textOpacity75 fontSize14 floatRight">1 <%= polyglot.t('of') %> 2</span>
8+
<span class="textOpacity75 fontSize14 floatRight"><%= polyglot.t('pageXofY', {currentPage: 1, totalPages: 2}) %></span>
99
</div>
1010
<form class="flexContainer flex-border homeModal-settings homeModal-settings-noSearch scrollOverflow custCol-primary customThemeScrollbar" id="storeWizardForm">
1111
<input name="header" id="headerInput" type="text" class="hide" value="<%= ob.page.profile.header_hash %>" />
@@ -83,7 +83,7 @@
8383
<div class="accordion-child accordion-inactive custCol-text">
8484
<div class="bar barTxt h6 custCol-secondary">
8585
<%= polyglot.t('StoreModeratorsOptional') %>
86-
<span class="textOpacity75 fontSize14 floatRight">2 <%= polyglot.t('of') %> 2</span>
86+
<span class="textOpacity75 fontSize14 floatRight"><%= polyglot.t('pageXofY', {currentPage: 2, totalPages: 2}) %></span>
8787
</div>
8888
<div class="flexContainer flex-border homeModal-settings homeModal-settings-noSearch scrollOverflow custCol-primary customThemeScrollbar">
8989
<div class="flexRow">
@@ -106,4 +106,4 @@
106106
</div>
107107
</div>
108108
</div>
109-
</div>
109+
</div>

js/views/itemVw.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module.exports = baseVw.extend({
6464
this.shipsLocal = this.shippingRegions.indexOf(this.shippingOrigin) > -1;
6565
this.nonLocalRegions = __.without(this.shippingRegions, this.shippingOrigin);
6666
this.worldwide = this.shippingRegions.length === 1 && this.shippingRegions[0] === 'ALL';
67-
67+
6868
this.render();
6969
},
7070

@@ -91,7 +91,7 @@ module.exports = baseVw.extend({
9191
var imageExtension = self.model.get('imageExtension') || "";
9292
});
9393
*/
94-
94+
9595
//el must be passed in from the parent view
9696
loadTemplate('./js/templates/item.html', function(loadedTemplate) {
9797
loadTemplate('./js/templates/ratingStars.html', function(starsTemplate) {
@@ -132,12 +132,12 @@ module.exports = baseVw.extend({
132132
photoGalleryClick: function(){
133133
$('.js-photoGallery').colorbox({
134134
'transition': 'fade',
135-
'rel': 'js-photoGallery',
135+
'rel': 'js-photoGallery',
136136
'photo': true,
137137
'fadeOut': 0,
138138
'previous': '<span class="arrowIcon ion-ios-arrow-back"></span>',
139139
'next': '<span class="arrowIcon ion-ios-arrow-forward"></span>',
140-
'current': '{current} ' + window.polyglot.t('of') + ' {total}',
140+
'current': window.polyglot.t('pageXofY', {currentPage: '{current}', totalPages: '{total}'}),
141141
'close': window.polyglot.t('Close'),
142142
'maxHeight': '620px',
143143
'opacity': '.95',
@@ -197,4 +197,4 @@ module.exports = baseVw.extend({
197197

198198
baseVw.prototype.remove.apply(this, arguments);
199199
}
200-
});
200+
});

0 commit comments

Comments
 (0)