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

Commit 9b53104

Browse files
committed
Merge pull request #1532 from rmisio/seperate-currencies
Seperate currencies
2 parents cc2b4b4 + 9161ea9 commit 9b53104

File tree

9 files changed

+418
-997
lines changed

9 files changed

+418
-997
lines changed

js/languages/en-US.json

Lines changed: 406 additions & 984 deletions
Large diffs are not rendered by default.

js/templates/item.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ <h4><%= polyglot.t('CanBeShippedTo') %></h4>
129129
<% var matchedItemShippableCountries = _.uniq(_.intersection(_.pluck(ob.userAddresses, 'country'), ob.vendor_offer.listing.shipping.shipping_regions));
130130
if(matchedItemShippableCountries.length > 0){
131131
_.each(matchedItemShippableCountries, function(data){
132-
print("<p>" + polyglot.t(`countries.${data}.name`) + "</p>");
132+
print("<p>" + polyglot.t(`countries.${data}`) + "</p>");
133133
});
134134
} else if(!ob.worldwide){
135135
print(polyglot.t('NoShippableAddress'));
136136
} else {
137137
_.each(_.uniq(_.pluck(ob.userAddresses, 'country')), function(data){
138-
print("<p>" + polyglot.t(`countries.${data}.name`) + "</p>");
138+
print("<p>" + polyglot.t(`countries.${data}`) + "</p>");
139139
});
140140
}
141141
%>

js/templates/transactionModal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ <h3 class="txt-bright"><%= polyglot.t('CheckExchanges') %> </h3>
727727
<%- ob.buyer_order.order.shipping.ship_to %>, <br />
728728
<%- ob.buyer_order.order.shipping.address %><br />
729729
<%- ob.buyer_order.order.shipping.city %>, <%- ob.buyer_order.order.shipping.state %> <%- ob.buyer_order.order.shipping.postal_code %><br />
730-
<%= polyglot.t('countries.' + ob.buyer_order.order.shipping.country + '.name') %>
730+
<%= polyglot.t('countries.' + ob.buyer_order.order.shipping.country) %>
731731
</div>
732732
</div>
733733
</div>

js/utils/localize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function localizeShippingRegions(regions) {
1111
if (region === 'ALL') {
1212
localized.push(polyglot.t('WorldwideShipping'));
1313
} else {
14-
localized.push(polyglot.t(`countries.${region}.name`));
14+
localized.push(polyglot.t(`countries.${region}`));
1515
}
1616
});
1717

js/views/buyWizardVw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module.exports = baseVw.extend({
8484
this.countryList = countries.get('countries');
8585
this.countriesSelect = $('<select class="chosen custCol-text" id="buyWizardCountryInput" required></select>');
8686
__.each(this.countryList, function(countryFromList, i){
87-
var countryOption = $('<option value="'+countryFromList.dataName+'" data-name="'+countryFromList.name +'">'+polyglot.t(`countries.${countryFromList.dataName}.name`)+'</option>');
87+
var countryOption = $('<option value="'+countryFromList.dataName+'" data-name="'+countryFromList.name +'">'+polyglot.t(`countries.${countryFromList.dataName}`)+'</option>');
8888
countryOption.attr("selected",self.options.userModel.get('country') == countryFromList.dataName);
8989
self.countriesSelect.append(countryOption);
9090
});

js/views/currencyListVw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ module.exports = baseVw.extend({
9090
this.listContents.push('checked="checked"');
9191
}
9292
this.listContents.push('>');
93-
this.listContents.push('<label class="homeModal-currency radioLabel" for="currency-'+ itemJSON.dataName +'">'+ polyglot.t(`countries.${itemJSON.dataName}.currency`) +'</label>');
93+
this.listContents.push('<label class="homeModal-currency radioLabel" for="currency-'+ itemJSON.dataName +'">'+ polyglot.t(`currencies.${itemJSON.code}`) +'</label>');
9494
this.listContents.push('</div></li>');
9595
}
9696
}

js/views/itemEditVw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ module.exports = baseVw.extend({
182182
});
183183
var shipsTo = this.$el.find('#shipsTo');
184184
__.each(countryList, function(countryFromList, i){
185-
var content = !i ? countryFromList.name : polyglot.t(`countries.${countryFromList.dataName}.name`);
185+
var content = !i ? countryFromList.name : polyglot.t(`countries.${countryFromList.dataName}`);
186186

187187
shipsTo.append(
188188
`<option value="${countryFromList.dataName}">${content}</option>`

js/views/itemVw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ module.exports = baseVw.extend({
104104
starsTemplate: starsTemplate,
105105
activeTab: self.activeTab,
106106
fetchingRatings: self.fetchingRatings,
107-
userCountry: polyglot.t(`countries.${self.userModel.get('country')}.name`),
107+
userCountry: polyglot.t(`countries.${self.userModel.get('country')}`),
108108
shippingRegionsDisplay: localize.localizeShippingRegions(self.shippingRegions),
109109
worldwide: self.worldwide,
110-
displayShippingOrigin: self.shippingOrigin && polyglot.t(`countries.${self.shippingOrigin}.name`)
110+
displayShippingOrigin: self.shippingOrigin && polyglot.t(`countries.${self.shippingOrigin}`)
111111
})
112112
)
113113
);

js/views/settingsVw.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,8 @@ module.exports = Backbone.View.extend({
422422
currencyList.unshift({code: "BTC", currency:"Bitcoin", currencyUnits: "4"});
423423

424424
__.each(countryList, function(c, i){
425-
var country_option = $('<option value="'+c.dataName+'" data-name="'+c.name+'">'+polyglot.t(`countries.${c.dataName}.name`)+'</option>');
426-
var ship_country_option = $('<option value="'+c.dataName+'" data-name="'+c.name+'">'+polyglot.t(`countries.${c.dataName}.name`)+'</option>');
425+
var country_option = $('<option value="'+c.dataName+'" data-name="'+c.name+'">'+polyglot.t(`countries.${c.dataName}`)+'</option>');
426+
var ship_country_option = $('<option value="'+c.dataName+'" data-name="'+c.name+'">'+polyglot.t(`countries.${c.dataName}`)+'</option>');
427427
country_option.attr("selected",user.country == c.dataName);
428428
//if user has a country in their profile, preselect it in the new address section
429429
ship_country_option.attr("selected",user.country== c.dataName);
@@ -434,8 +434,7 @@ module.exports = Backbone.View.extend({
434434
__.each(currencyList, function(c, i){
435435
//only show currently available currencies
436436
if(self.availableCurrenciesList.indexOf(c.code) > -1 || c.code === "BTC"){
437-
var currency = c.code === 'BTC' ? c.currency : polyglot.t(`countries.${c.dataName}.currency`),
438-
currency_option = $('<option value="'+c.code+'">'+currency+'</option>');
437+
var currency_option = $('<option value="'+c.code+'">'+ polyglot.t(`currencies.${c.code}`) +'</option>');
439438
currency_option.attr("selected",user.currency_code == c.code);
440439
currency_str += currency_option[0].outerHTML;
441440
}

0 commit comments

Comments
 (0)