@samitouri / QOSami-HFS / commits / 904725d9

fix: download counter in file menu was not translated

Massimo Melina committed Jun 28, 2023 at 22:23 UTC 904725d9047b9df4ad8314bfd0d1b03115b9a846
4 files changed +10 -12
plugins/download-counter/public/main.js
+3 -2
@@ -1,12 +1,13 @@
1 { // this wrapper avoids name clashing of outer variables and functions
2 const config = HFS.getPluginConfig()
3
4 + const label = HFS.t(["Download counter", "download counter"])
5 const inMenu = config.where === 'menu'
6 HFS.onEvent('additionalEntryDetails', ({ entry: { hits } }) =>
6 - hits && !inMenu && `<span class="download-counter" title="${HFS.t`download counter`}">${hits}</span>`)
7 + hits && !inMenu && `<span class="download-counter" title="${label}">${hits}</span>`)
8
9 HFS.onEvent('fileMenu', ({ entry, props }) => {
10 if (inMenu && !entry.isFolder)
10 - props.push(["Downloads", entry.hits || 0])
11 + props.push([label, entry.hits || 0])
12 })
13 }
\ No newline at end of file
src/langs/hfs-lang-en.json
+2 -3
@@ -102,8 +102,6 @@
102 "upload_errors": "{n} failed",
103 "upload_file_rejected": "Some files were not accepted",
104
105 - "download counter": "download counter",
106 -
105 "File menu": "File menu",
106 "Folder menu": "Folder menu",
107 "Name": "Name",
@@ -121,6 +119,7 @@
119 "Tiles mode:": "Tiles mode:",
120 "off": "off",
121 "Operation successful": "Operation successful",
124 - "Uploader": "Uploader"
122 + "Uploader": "Uploader",
123 + "Download counter": "Download counter"
124 }
125 }
src/langs/hfs-lang-it.json
+2 -3
@@ -96,8 +96,6 @@
96 "upload_errors": "{n,plural, one{# fallito} other{# falliti}}",
97 "upload_file_rejected": "Alcuni file non sono stati accettati",
98
99 - "download counter": "download conteggiati",
100 -
99 "File menu": "Menu file",
100 "Folder menu": "Menu cartella",
101 "Name": "Nome",
@@ -115,6 +113,7 @@
113 "Tiles mode:": "Griglia:",
114 "off": "no",
115 "Operation successful": "Operazione riuscita",
118 - "Uploader": "Upload da"
116 + "Uploader": "Upload da",
117 + "Download counter": "Download conteggiati"
118 }
119 }
src/langs/hfs-lang-ru.json
+3 -4
@@ -1,6 +1,6 @@
1 {
2 "author": "Mefistofell, SanokKule",
3 - "version": 1.96,
3 + "version": 1.97,
4 "hfs_version": "0.46.0",
5 "translate": {
6 "Select": "Выбор",
@@ -102,8 +102,6 @@
102 "upload_errors": "{n,plural, one{# файл} few{# файла} other{# файлов}} не удалось загрузить",
103 "upload_file_rejected": "Некоторые файлы не были приняты",
104
105 - "download counter": "Количество скачиваний",
106 -
105 "File menu": "Меню файла",
106 "Folder menu": "Меню папки",
107 "Name": "Имя",
@@ -121,6 +119,7 @@
119 "Tiles mode:": "Плитки:",
120 "off": "выключено",
121 "Operation successful": "Операция успешна",
124 - "Uploader": "Загрузчик"
122 + "Uploader": "Загрузчик",
123 + "Download counter": "Счётчик загрузок"
124 }
125 }