diff --git a/web/assets/js/main.js b/web/assets/js/main.js index 945627e..f37fd88 100644 --- a/web/assets/js/main.js +++ b/web/assets/js/main.js @@ -251,9 +251,12 @@ thead_date.addEventListener('click', e => { }); +const size_units = document.getElementsByTagName("html")[0].lang == "ru" ? + {"Б": 0, "КиБ": 1, "МиБ": 2, "ГиБ": 3, "ТиБ": 4} : + {"B": 0, "KiB": 1, "MiB": 2, "GiB": 3, "TiB": 4}; function sizeToBytes(size, unit) { - if (units[unit] == 0) return size; - for (let i = 0; i <= units[unit]; ++i) size *= 1024; + if (size_units[unit] == 0) return size; + for (let i = 0; i <= size_units[unit]; ++i) size *= 1024; return size; }