Browse Source

Added module list localization

Toby Chui 1 năm trước cách đây
mục cha
commit
f3cea080c9

BIN
arozos.exe~


+ 2 - 2
setting.go

@@ -48,7 +48,7 @@ func SystemSettingInit() {
 	})
 }
 
-//Setting group defination. Your setting module defination must match the group in-order to be shown
+// Setting group defination. Your setting module defination must match the group in-order to be shown
 func system_setting_getSettingGroups() []settingGroup {
 	return []settingGroup{
 		{
@@ -118,7 +118,7 @@ func registerSetting(thismodule settingModule) {
 	settingModules = append(settingModules, thismodule)
 }
 
-//List all the setting modules and output it as JSON
+// List all the setting modules and output it as JSON
 func system_setting_handleListing(w http.ResponseWriter, r *http.Request) {
 	userinfo, err := userHandler.GetUserInfoFromRequest(w, r)
 	if err != nil {

+ 2 - 2
web/SystemAO/disk/instr/samba.html

@@ -58,10 +58,10 @@
                     let visableLogo = "";
                     if (!smbShare.Browseable){
                         //This share is hidden from the share tree view
-
+                        visableLogo = `<i class="eye slash outline icon"></i>`;
                     }
                     $("#userShareList").append(`<tr>
-                        <td>${smbShare.Name}</td>
+                        <td>${visableLogo} ${smbShare.Name}</td>
                         <td class="smbaddr" data-clipboard-text="\\\\${window.location.hostname}\\${smbShare.Name}" ><small>\\\\${window.location.hostname}\\${smbShare.Name}</small></td>
                         <td>${smbShare.ValidUsers.join(", ")}</td>
                     </tr>`);

+ 3 - 3
web/SystemAO/locale/system_settings.json

@@ -10,7 +10,7 @@
                 "menu/group/Host Information":"系統資訊",
                 "menu/group/Devices & IoT":"裝置與物聯網",
                 "menu/group/Module Management":"模組管理",
-                "menu/group/Disk & Storage":"磁碟與儲存",
+                "menu/group/Disk & Storage":"磁碟與儲存裝置",
                 "menu/group/Network & Connection":"網絡與連接",
                 "menu/group/Users & Groups":"使用者及群組",
                 "menu/group/Clusters & Scheduling":"集群與排程",
@@ -145,7 +145,7 @@
                 "menu/group/Host Information":"系統資訊",
                 "menu/group/Devices & IoT":"裝置與物聯網",
                 "menu/group/Module Management":"模組管理",
-                "menu/group/Disk & Storage":"磁碟與儲存",
+                "menu/group/Disk & Storage":"磁碟與儲存裝置",
                 "menu/group/Network & Connection":"網絡與連接",
                 "menu/group/Users & Groups":"使用者及群組",
                 "menu/group/Clusters & Scheduling":"集群與排程",
@@ -279,7 +279,7 @@
                 "menu/group/Host Information":"系统信息",
                 "menu/group/Devices & IoT":"设备与物联网",
                 "menu/group/Module Management":"模块管理",
-                "menu/group/Disk & Storage":"硬盘与储存",
+                "menu/group/Disk & Storage":"硬盘与储存装置",
                 "menu/group/Network & Connection":"网络与连接",
                 "menu/group/Users & Groups":"用户及群组",
                 "menu/group/Clusters & Scheduling":"集群与计划",

+ 64 - 0
web/SystemAO/locale/system_settings/modulelist.json

@@ -0,0 +1,64 @@
+{
+    "author": "tobychui",
+    "version": "1.0",
+    "keys": {
+        "zh-tw": {
+            "name": "繁體中文(台灣)",
+            "fontFamily":"\"Microsoft JhengHei\",\"SimHei\", \"Apple LiGothic Medium\", \"STHeiti\"",
+            "strings": {
+                "title/title": "已安裝之應用程式",
+                "table/module":"網頁應用程式",
+                "table/group":"群組",
+                "table/ext":"支援的副檔名",
+                "table/modes": "界面模式",
+                "table/modes/default": "預設",
+                "table/modes/floatwindow": "浮動視窗",
+                "table/modes/embedded": "嵌入式",
+                "desc/reload":"在手動安裝 WebApp 後,你可以按「重新載入 WebApp」以載入新安裝的應用程式而不需要重啟 ArozOS 系統。",
+                "button/reload": "重新載入 WebApp",
+                "item/version":"版本:"
+            },
+            "titles": {},
+            "placeholder": {}
+        },
+        "zh-hk": {
+            "name": "繁體中文(香港)",
+            "fontFamily":"\"Microsoft JhengHei\",\"SimHei\", \"Apple LiGothic Medium\", \"STHeiti\"",
+            "strings": {
+                "title/title": "已安裝之 WebApp",
+                "table/module":"WebApp",
+                "table/group":"群組",
+                "table/ext":"支援的副檔名",
+                "table/modes": "界面模式",
+                "table/modes/default": "預設",
+                "table/modes/floatwindow": "浮動視窗",
+                "table/modes/embedded": "嵌入式",
+                "desc/reload":"在手動安裝 WebApp 後,你可以按「重新載入 WebApp」以載入新安裝的應用程式而不需要重啟 ArozOS 系統。",
+                "button/reload": "重新載入 WebApp",
+                "item/version":"版本:"
+            },
+            "titles": {},
+            "placeholder": {}
+        },
+
+        "en-us": {
+            "name": "English (US)",
+            "fontFamily":"Arial, Helvetica, sans-serif",
+            "strings": {
+                "title/title": "Module List",
+                "table/module":"Module",
+                "table/group":"Group",
+                "table/ext":"Supported Extensions",
+                "table/modes": "Supported Mode",
+                "table/modes/default": "Default",
+                "table/modes/floatwindow": "FloatWindow",
+                "table/modes/embedded": "Embedded",
+                "desc/reload":"If you have installed WebApps manually, you can click the \"Reload WebApps\" button to load it without restarting ArozOS.",
+                "button/reload": "Reload WebApps",
+                "item/version":"Version: "
+            },
+            "titles": {},
+            "placeholder": {}
+        }
+    }
+}

+ 23 - 12
web/SystemAO/modules/moduleList.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <title>Module List</title>
+        <title locale="title/title">Module List</title>
         <meta charset="UTF-8">
         <meta name="viewport" content="width=device-width, initial-scale=1.0 user-scalable=no">
         <link rel="stylesheet" href="../../script/semantic/semantic.min.css">
@@ -15,15 +15,15 @@
                 <table class="ui basic celled structured unstackable table">
                     <thead>
                     <tr>
-                        <th rowspan="2">Module</th>
-                        <th rowspan="2">Group</th>
-                        <th rowspan="2">Supported Extensions</th>
-                        <th colspan="3">Supported Mode</th>
+                        <th rowspan="2" locale="table/module">Module</th>
+                        <th rowspan="2" locale="table/group">Group</th>
+                        <th rowspan="2" locale="table/ext">Supported Extensions</th>
+                        <th colspan="3" locale="table/modes">Supported Mode</th>
                     </tr>
                     <tr>
-                        <th>Default</th>
-                        <th>FloatWindow</th>
-                        <th>Embedded</th>
+                        <th locale="table/modes/default">Default</th>
+                        <th locale="table/modes/floatwindow">FloatWindow</th>
+                        <th locale="table/modes/embedded">Embedded</th>
                     </tr>
                     </thead>
                     <tbody id="moduleList">
@@ -32,14 +32,22 @@
                 </table>
             </div>
               <div class="ui divider"></div>
-              <p>If you have installed WebApps manually, you can click the "Reload WebApps" button to load it without restarting ArozOS.</p>
+              <p locale="desc/reload">If you have installed WebApps manually, you can click the "Reload WebApps" button to load it without restarting ArozOS.</p>
               <button id="reloadWebappButton" class="ui basic small blue button" onclick="reloadWebapps();">
-                <i class="refresh icon"></i> Reload WebApps
+                <i class="refresh icon"></i> <span locale="button/reload">Reload WebApps</span>
               </button>
               <br><br>
         </div>
         <script>
-            initModuleList();
+
+            //Applocale
+            var moduleListLocale = NewAppLocale();
+            moduleListLocale.init("../locale/system_settings/modulelist.json", function(){
+                moduleListLocale.translate();
+                initModuleList();
+            });
+
+            
 
             function reloadWebapps(){
                 let moduleListBackup = $("#moduleList").html();
@@ -93,7 +101,7 @@
                                         <img src="${iconURL}" class="ui mini rounded image">
                                         <div class="content">
                                             ${thisModule.Name}
-                                            <div class="sub header">Version: ${thisModule.Version} </div>
+                                            <div class="sub header">${moduleListLocale.getString("item/version", "Version:")} ${thisModule.Version} </div>
                                         </div>
                                     </h4>
                                 </td>
@@ -117,6 +125,9 @@
                     }
                 });
             }
+
+            
+            
         </script>
     </body>
 </html>