How to use the i18n._ function in i18n

To help you get started, we’ve selected a few i18n examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Khan / live-editor / js / ui / errorbuddy-mini.js View on Github external
} else {
            errorMood = (
                <button>
                    <img src="{`${this.props.imagesDir}creatures/OhNoes-Hmm.png`}" alt="{i18n._(&quot;Error">
                    {/* I18N: The CS error buddy is thinking there might be an
                    * error in your code and is waiting for you to fix it. */}
                    {i18n._("Hmm...")}
                </button>
            );
        }
        return (
            <div>
                <div>{errorMood}</div>
            </div>
        );
    }
}
github binary-com / binary-bot / src / cat / bot / view / index.js View on Github external
var stopTutorial = function stopTutorial(e) {
	if (e) {
		e.preventDefault();
	}
	if (activeTutorial) {
		if (e) {
			activeTutorial.stop();
		}
		activeTutorial = null;
	}
	$('#tutorialButton')
		.unbind('click.stopTutorial')
		.bind('click.startTutorial', startTutorial)
		.text(i18n._('Go!'));
};
github binary-com / binary-bot / newDesign / botPage / view / botView.js View on Github external
.each(function() {
			    	var contents = $(this).contents();
			    	if (contents.length > 0) {
			        	if (contents.get(0).nodeType == Node.TEXT_NODE) {
			            	$(this).text(i18n._($(this)
								.attr('data-i18n-text')))
								.append(contents.slice(1));
			        	}
			    	} else {
						$(this)
							.text(i18n._($(this)
								.attr('data-i18n-text')));
					}
				});
				done();
github binary-com / binary-bot / src / bot / utils / view.js View on Github external
blockly.WidgetDiv.hideIfOwner(blockly.mainWorkspace.getBlockById('trade')
		.getField('ACCOUNT_LIST'));
	if (tokenList.length === 0) {
		$('#addAccount')
			.text('Login');
		$('#logout')
			.hide();
		globals.lists.accounts = [
			[i18n._('Please add a token first'), '']
		];
		blockly.mainWorkspace.getBlockById('trade')
			.getField('ACCOUNT_LIST')
			.setValue('');
		blockly.mainWorkspace.getBlockById('trade')
			.getField('ACCOUNT_LIST')
			.setText(i18n._('Please add a token first'));
	} else {
		$('#addAccount')
			.text('Add Token');
		$('#logout')
			.show();
		globals.lists.accounts = [];
		tokenList.forEach(function (tokenInfo) {
			globals.lists.accounts.push([tokenInfo.account_name, tokenInfo.token]);
		});
		var tokenInfoToAdd = tokenList[0];
		if (tokenToAdd !== undefined) {
			var tokenInfoIndex = storageManager.findToken(tokenToAdd);
			if (tokenInfoIndex >= 0) {
				tokenInfoToAdd = tokenList[tokenInfoIndex];
			}
		}
github binary-com / binary-bot / src / newdesign / botPage / ctrl / trade / index.js View on Github external
globals.tradeInfo.totalPayout = +(+globals.tradeInfo.totalPayout + (+contract.sell_price))
		.toFixed(2);
	globals.tradeInfo.totalProfit = +(+globals.tradeInfo.totalProfit + (+globals.tradeInfo.lastProfit))
		.toFixed(2);
	globals.tradeInfo.lastResult = result;
	globals.updateTradeInfo();

	var detail_list = [
		contract.transaction_ids.buy, +contract.buy_price, +contract.sell_price,
		globals.tradeInfo.lastProfit,
		contract.contract_type, +contract.entry_tick,
		botUtils.getUTCTime(new Date(parseInt(contract.entry_tick_time + '000'))), +contract.exit_tick,
		botUtils.getUTCTime(new Date(parseInt(contract.exit_tick_time + '000'))), +((contract.barrier) ? contract.barrier : 0),
	];

	log(i18n._('Purchase was finished, result is:') + ' ' + result, (result === 'win') ? 'success' : 'error');

	globals.on_finish(result, detail_list);
	purchasedContractId = '';
	contractForChart = null;
	finished = true;
	globals.disableRun(false);
};
github Khan / live-editor / js / ui / errorbuddy-mini.js View on Github external
render() {
        if (this.props.isHidden) {
            return null;
        }
        let errorMood;

        if (this.props.errorState === "happy") {
            errorMood = (
                <div style="{{height:">
                    <img src="{`${" alt="{i18n._(&quot;Error">
                </div>
            );
        } else {
            errorMood = (
                <button>
                    </button>
github binary-com / binary-bot / src / newdesign / botPage / ctrl / trade / index.js View on Github external
var purchase = function purchase(option) {
	purchased = true;
	strategyEnabled = false;
	var proposalContract = (option === contracts[1].echo_req.contract_type) ? contracts[1] : contracts[0];
	log(i18n._('Purchased') + ': ' + proposalContract.proposal.longcode, 'info');
	api.buyContract(proposalContract.proposal.id, proposalContract.proposal.ask_price)
		.then(function (purchaseContract) {
			purchasedContractId = purchaseContract.buy.contract_id;
			api.subscribeToOpenContract(purchasedContractId);
			globals.tradeInfo.numOfRuns++;
			globals.updateTradeInfo();
			globals.disableRun(true);
		}, function (reason) {
			stop();
			showError(reason);
		});
};
github binary-com / binary-bot / src / newdesign / botPage / ctrl / trade / index.js View on Github external
}, function (reason) {
			log(i18n._('Could not get balance'));
		});
};
github binary-com / binary-bot / src / botPage / trade / trade.js View on Github external
api.events.on('tick', function (feed) {
		log(i18n._('tick received at:') + ' ' + feed.tick.epoch);
		ticks = ticks.concat({
			epoch: +feed.tick.epoch,
			quote: +feed.tick.quote,
		});
		updateChart();
		callStrategy();
	});