Skip to content

Commit 87bff8f

Browse files
text.localize
1 parent 3fc086d commit 87bff8f

File tree

9 files changed

+28
-16
lines changed

9 files changed

+28
-16
lines changed

src/javascript/binary/common_functions/frontend.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ function handle_residence_state_ws(){
411411
} else if (type === 'website_status') {
412412
var status = response.website_status;
413413
if (status && status.clients_country) {
414+
if (status.clients_country === 'jp' || japanese_client()) {
415+
$('#residence').replaceWith('<label>' + page.text.localize('Japan') + '</label>');
416+
}
414417
var clientCountry = $('#residence option[value="' + status.clients_country + '"]');
415418
if (!clientCountry.attr('disabled')) {
416419
clientCountry.prop('selected', true);

src/javascript/binary/websocket_pages/trade/beta/charts/digit_infows.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,19 @@ TradingAnalysis_Beta.DigitInfoWS.prototype = {
103103
underlyings = underlyings.sort();
104104
var elem = '<select class="smallfont" name="underlying">';
105105
for(i=0;i<underlyings.length;i++){
106-
elem = elem + '<option value="'+underlyings[i]+'">'+text.localize(symbols[underlyings[i]])+'</option>';
106+
elem = elem + '<option value="' + underlyings[i] + '">' + page.text.localize(symbols[underlyings[i]]) + '</option>';
107107
}
108108
elem = elem + '</select>';
109109
var contentId = document.getElementById('tab_last_digit-content'),
110110
content = '<div class="gr-parent">'+
111111
'<div id="last_digit_histo_form" class="gr-12 gr-12-m gr-centered">'+
112112
'<form class="smallfont gr-row" action="#" method="post">'+
113-
'<div class="gr-6 gr-12-m center-text"><div class="gr-padding-10">'+ text.localize('Select market')+':</div>' + elem +' </div>'+
114-
'<div class="gr-6 gr-12-m center-text"><div class="gr-padding-10">'+ text.localize('Number of ticks')+':</div><select class="smallfont" name="tick_count"><option value="25">25</option><option value="50">50</option><option selected="selected" value="100">100</option><option value="500">500</option><option value="1000">1000</option></select></div>'+
113+
'<div class="gr-6 gr-12-m center-text"><div class="gr-padding-10">'+ page.text.localize('Select market')+':</div>' + elem +' </div>'+
114+
'<div class="gr-6 gr-12-m center-text"><div class="gr-padding-10">'+ page.text.localize('Number of ticks')+':</div><select class="smallfont" name="tick_count"><option value="25">25</option><option value="50">50</option><option selected="selected" value="100">100</option><option value="500">500</option><option value="1000">1000</option></select></div>'+
115115
'</form>'+
116116
'</div>'+
117117
'<div id="last_digit_histo" class="gr-12 gr-12-m gr-centered"></div>'+
118-
'<div id="last_digit_title" class="gr-hide">'+ (domain.charAt(0).toUpperCase() + domain.slice(1)) + ' - ' + text.localize('Last digit stats for the latest [_1] ticks on [_2]') +'</div>'+
118+
'<div id="last_digit_title" class="gr-hide">'+ (domain.charAt(0).toUpperCase() + domain.slice(1)) + ' - ' + page.text.localize('Last digit stats for the latest [_1] ticks on [_2]') +'</div>'+
119119
'</div>';
120120
contentId.innerHTML = content;
121121
$('[name=underlying]').val(underlying);

src/javascript/binary/websocket_pages/trade/beta/contract.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ var Contract_Beta = (function() {
107107
}
108108

109109
if (!contractType[contractCategory].hasOwnProperty(currentObj['contract_type'])) {
110-
contractType[contractCategory][currentObj['contract_type']] = text.localize(currentObj['contract_display']);
110+
contractType[contractCategory][currentObj['contract_type']] = page.text.localize(currentObj['contract_display']);
111111
}
112112
}
113113
});
@@ -139,7 +139,7 @@ var Contract_Beta = (function() {
139139
tradeContractForms['higherlower'] = Content.localize().textFormHigherLower;
140140
}
141141
} else {
142-
tradeContractForms[contractCategory] = text.localize(currentObj['contract_category_display']);
142+
tradeContractForms[contractCategory] = page.text.localize(currentObj['contract_category_display']);
143143
if (contractCategory === 'digits') {
144144
tradeContractForms['matchdiff'] = Content.localize().textFormMatchesDiffers;
145145
if (page.language() !== 'ID') {

src/javascript/binary/websocket_pages/trade/beta/price.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ var Price_Beta = (function() {
198198
amount.textContent = data['display_value'];
199199
} else {
200200
$('.stake:hidden').show();
201-
stake.textContent = text.localize('Stake') + ': ';
201+
stake.textContent = page.text.localize('Stake') + ': ';
202202
amount.textContent = format_money(currency.value, (data['display_value']*1).toFixed(2));
203203
}
204204
$('.stake_wrapper:hidden').show();
@@ -207,7 +207,7 @@ var Price_Beta = (function() {
207207
}
208208

209209
if (data['payout']) {
210-
payout.textContent = (is_spread ? text.localize('Payout/point') : text.localize('Payout')) + ': ';
210+
payout.textContent = (is_spread ? page.text.localize('Payout/point') : page.text.localize('Payout')) + ': ';
211211
payoutAmount.textContent = format_money(currency.value, (data['payout']*1).toFixed(2));
212212
$('.payout_wrapper:hidden').show();
213213
} else {

src/javascript/binary/websocket_pages/trade/beta/process.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function processContract_Beta(contracts) {
101101
contracts_list.style.display = 'none';
102102
message_container.hide();
103103
confirmation_error.show();
104-
confirmation_error_contents.innerHTML = contracts.error.message + ' <a href="javascript:;" onclick="TradePage_Beta.reload();">' + text.localize('Please reload the page') + '</a>';
104+
confirmation_error_contents.innerHTML = contracts.error.message + ' <a href="javascript:;" onclick="TradePage_Beta.reload();">' + page.text.localize('Please reload the page') + '</a>';
105105
return;
106106
}
107107

src/javascript/binary/websocket_pages/trade/beta/purchase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var Purchase_Beta = (function () {
3939
container.style.display = 'block';
4040
message_container.hide();
4141
confirmation_error.show();
42-
confirmation_error_contents.innerHTML = (/ClientUnwelcome/.test(error.code) ? error['message'] + '<a class="pjaxload" href="' + page.url.url_for('user/authenticatews') + '"> ' + text.localize('Authorise your account.' + '</a>') : error['message']);
42+
confirmation_error_contents.innerHTML = (/ClientUnwelcome/.test(error.code) ? error['message'] + '<a class="pjaxload" href="' + page.url.url_for('user/authenticatews') + '"> ' + page.text.localize('Authorise your account.' + '</a>') : error['message']);
4343
} else {
4444
var guideBtn = document.getElementById('guideBtn');
4545
if(guideBtn) {

src/javascript/binary/websocket_pages/trade/beta/tick_trade.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ var TickDisplay_Beta = function() {
106106
zIndex: 1
107107
},
108108
title: {
109-
text: text.localize('Tick')
109+
text: page.text.localize('Tick')
110110
}
111111
},
112112
yAxis: {
@@ -304,11 +304,11 @@ var TickDisplay_Beta = function() {
304304
var $self = this;
305305

306306
var profit = $self.payout - $self.price;
307-
$self.update_ui($self.payout, profit, text.localize('This contract won'));
307+
$self.update_ui($self.payout, profit, page.text.localize('This contract won'));
308308
},
309309
lose: function() {
310310
var $self = this;
311-
$self.update_ui(0, -$self.price, text.localize('This contract lost'));
311+
$self.update_ui(0, -$self.price, page.text.localize('This contract lost'));
312312
},
313313
to_monetary_format: function(number) {
314314
return number.toFixed(2);

src/javascript/binary/websocket_pages/user/account/statement/statement.ui.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,17 @@ var StatementUI = (function(){
4747

4848
var jpClient = japanese_client();
4949

50-
var $statementRow = Table.createFlexTableRow([(jpClient ? toJapanTimeIfNeeded(transaction.transaction_time) : statement_data.date), '<span' + showTooltip(statement_data.app_id, oauth_apps[statement_data.app_id]) + '>' + statement_data.ref + '</span>', isNaN(statement_data.payout) ? '-' : (jpClient ? format_money_jp(TUser.get().currency, statement_data.payout) : statement_data.payout ), page.text.localize(statement_data.action), '', jpClient ? format_money_jp(TUser.get().currency, statement_data.amount) : statement_data.amount, jpClient ? format_money_jp(TUser.get().currency, statement_data.balance) : statement_data.balance, ''], columns, "data");
51-
50+
var $statementRow = Table.createFlexTableRow([
51+
(jpClient ? toJapanTimeIfNeeded(transaction.transaction_time) : statement_data.date),
52+
'<span' + showTooltip(statement_data.app_id, oauth_apps[statement_data.app_id]) + '>' + statement_data.ref + '</span>',
53+
isNaN(statement_data.payout) ? '-' : (jpClient ? format_money_jp(TUser.get().currency, statement_data.payout) : statement_data.payout ),
54+
page.text.localize(statement_data.action),
55+
'',
56+
jpClient ? format_money_jp(TUser.get().currency, statement_data.amount) : statement_data.amount,
57+
jpClient ? format_money_jp(TUser.get().currency, statement_data.balance) : statement_data.balance,
58+
''
59+
], columns, "data");
60+
5261
$statementRow.children(".credit").addClass(creditDebitType);
5362
$statementRow.children(".date").addClass("pre");
5463
$statementRow.children(".desc").html(statement_data.desc + "<br>");

src/javascript/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ window.Cookies = require('./lib/js-cookie.js');
2525
require('./lib/loadCSS.js');
2626
require('./lib/loadJS.js');
2727
window.pjax = require('./lib/pjax-lib.js');
28-
require('./lib/resize-sensor.js');
28+
window.ResizeSensor = require('./lib/resize-sensor.js');
2929
window.dv = require('./lib/validation.js');
3030

3131
require('./binary/components/trackjs_onerror');

0 commit comments

Comments
 (0)