Translate thousands separator in JS

This commit is contained in:
Jakub Vrana 2018-02-06 14:46:50 +01:00
parent 31d8803db2
commit d3914ea58e
2 changed files with 4 additions and 1 deletions

View file

@ -58,6 +58,7 @@ mixin(document.body, {onkeydown: bodyKeydown, onclick: bodyClick<?php
?>});
document.body.className = document.body.className.replace(/ nojs/, ' js');
var offlineMessage = '<?php echo js_escape(lang('You are offline.')); ?>';
var thousandsSeparator = '<?php echo js_escape(lang(',')); ?>';
</script>
<div id="help" class="jush-<?php echo $jush; ?> jsonly hidden"></div>

View file

@ -172,9 +172,10 @@ function trCheck(el) {
/** Fill number of selected items
* @param string
* @param string
* @uses thousandsSeparator
*/
function selectCount(id, count) {
setHtml(id, (count === '' ? '' : '(' + (count + '').replace(/\B(?=(\d{3})+$)/g, ' ') + ')'));
setHtml(id, (count === '' ? '' : '(' + (count + '').replace(/\B(?=(\d{3})+$)/g, thousandsSeparator) + ')'));
var el = qs('#' + id);
if (el) {
var inputs = qsa('input', el.parentNode.parentNode);
@ -580,6 +581,7 @@ function fieldChange() {
* @param [string]
* @param [string]
* @return XMLHttpRequest or false in case of an error
* @uses offlineMessage
*/
function ajax(url, callback, data, message) {
var request = (window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false));