Jelajahi Sumber

Fixed missing localization fields

- Added empty folder location to all languages
- Fixed applocale.js bug
Toby Chui 5 bulan lalu
induk
melakukan
d7fc22d687
3 mengubah file dengan 14 tambahan dan 5 penghapusan
  1. 1 0
      .gitignore
  2. 7 3
      src/web/SystemAO/locale/file_explorer.json
  3. 6 2
      src/web/script/applocale.js

+ 1 - 0
.gitignore

@@ -32,3 +32,4 @@ src/tmp/aofs.db.lock
 src/system/smtp_conf.json
 src/system/cron.json
 src/system/bridge.json
+/src/tmp

+ 7 - 3
src/web/SystemAO/locale/file_explorer.json

@@ -36,7 +36,7 @@
                 "fileopr/Select All": "全選",
                 "fileopr/Clear Select": "取消選擇",
                 "fileopr/New File": "新增檔案",
-                "fileopr/New Folder": "新增<br>資料夾",
+                "fileopr/New Folder": "<small style='font-size: 0.8em;'>新增資料夾</small>",
                 "fileopr/Upload": "上載",
                 "fileopr/Create Zip": "建立壓縮檔",
                 "fileopr/Unzip Here": "解壓縮至此",
@@ -219,6 +219,7 @@
                 "message/Recursive copy operation.": "遞歸複製操作",
                 "message/Source and destination paths are identical.": "檔案來源與目的地相同",
                 "message/Multiple files share is currently not supported": "不支援多個檔案分享",
+                "message/folderIsEmpty": "此為空白資料夾",
                 "message/noMatchResults": "找不到匹配的檔案",
                 "message/noMatchResultsDesc": "伺服器找不到與此關鍵字匹配的檔案",
                 "message/noMatchResultsInst": "請檢查你的關鍵字或通配符是否正確。",
@@ -300,7 +301,7 @@
                 "fileopr/Select All": "全選",
                 "fileopr/Clear Select": "取消選擇",
                 "fileopr/New File": "新增檔案",
-                "fileopr/New Folder": "新增資料夾",
+                "fileopr/New Folder": "<small style='font-size: 0.8em;'>新增資料夾</small>",
                 "fileopr/Upload": "上載",
                 "fileopr/Create Zip": "建立壓縮檔",
                 "fileopr/Unzip Here": "解壓縮至此",
@@ -483,6 +484,7 @@
                 "message/Recursive copy operation.": "遞歸複製操作",
                 "message/Source and destination paths are identical.": "檔案來源與目的地相同",
                 "message/Multiple files share is currently not supported": "不支援多個檔案分享",
+                "message/folderIsEmpty": "此為空白資料夾",
                 "message/noMatchResults": "找不到匹配的檔案",
                 "message/noMatchResultsDesc": "伺服器找不到與此關鍵字匹配的檔案",
                 "message/noMatchReembeddedsultsInst": "請檢查你的關鍵字或通配符是否正確。",
@@ -561,7 +563,7 @@
                 "fileopr/Select All": "全选",
                 "fileopr/Clear Select": "取消选择",
                 "fileopr/New File": "新增文件",
-                "fileopr/New Folder": "新建文件夹",
+                "fileopr/New Folder": "<small style='font-size: 0.8em;'>新建文件夹</small>",
                 "fileopr/Upload": "上传",
                 "fileopr/Create Zip": "创建压缩文件",
                 "fileopr/Unzip Here": "解压缩至此",
@@ -1005,6 +1007,7 @@
                 "message/Recursive copy operation.": "再帰的なコピー操作です",
                 "message/Source and destination paths are identical.": "ソースと宛先のパスが同じです",
                 "message/Multiple files share is currently not supported": "複数のファイルの共有は現在サポートされていません",
+                "message/folderIsEmpty": "このフォルダは空です",
                 "message/noMatchResults": "一致するファイルが見つかりませんでした",
                 "message/noMatchResultsDesc": "サーバーがキーワードに一致するファイルを見つけられませんでした。",
                 "message/noMatchResultsInst": "キーワードまたはワイルドカードが正しいかどうかを確認してください。",
@@ -1268,6 +1271,7 @@
                 "message/Recursive copy operation.": "재귀 복사 작업",
                 "message/Source and destination paths are identical.": "소스 및 대상 경로가 동일합니다",
                 "message/Multiple files share is currently not supported": "현재 다중 파일 공유는 지원되지 않습니다",
+                "message/folderIsEmpty": "이 폴더는 비어 있습니다",
                 "message/noMatchResults": "일치하는 파일을 찾을 수 없습니다",
                 "message/noMatchResultsDesc": "서버에서 이 키워드와 일치하는 파일을 찾을 수 없습니다",
                 "message/noMatchResultsInst": "키워드나 와일드카드를 올바르게 입력했는지 확인하십시오.",

+ 6 - 2
src/web/script/applocale.js

@@ -91,7 +91,11 @@ function NewAppLocale() {
                 el.title = localized.titles[attr];
             }
             if (localized?.strings?.[attr]) {
-                el.textContent = localized.strings[attr];
+                if (/<[a-z][^>]*>/i.test(localized.strings[attr])) {
+                    el.innerHTML = localized.strings[attr]; // Replace with HTML content
+                } else {
+                    el.textContent = localized.strings[attr]; // Replace with plain text
+                }
             }
             if (el.placeholder && localized?.placeholder?.[attr]) {
                 el.placeholder = localized.placeholder[attr];
@@ -101,7 +105,7 @@ function NewAppLocale() {
         // API
         getString: function(key, original) {
             if (this.lang === 'en-us') return original; // Directly return original if English
-            if (!!this.localData ){
+            if (!this.localData || !this.localData.keys){
                 return original;
             }
             return this.localData.keys[this.lang]?.strings?.[key] || original;