Alan Yeung 2 年之前
父節點
當前提交
ff34da2588
共有 2 個文件被更改,包括 71 次插入10 次删除
  1. 17 10
      web/SystemAO/iot/info.html
  2. 54 0
      web/SystemAO/locale/system_info_iot.json

+ 17 - 10
web/SystemAO/iot/info.html

@@ -1,30 +1,33 @@
 <!DOCTYPE html>
 <html ng-app="App">
 <head>
-    <title>IoT Control Panel</title>
+    <title locale="locale/iot-control-panel-title">IoT Control Panel</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">
     <script type="text/javascript" src="../../script/jquery.min.js"></script>
     <script type="text/javascript" src="../../script/semantic/semantic.min.js"></script>
+    <script type="text/javascript" src="../../script/applocale.js"></script>
 </head>
 <body>
     <div class="ui container">
         <div class="ui basic segment">
             <h3 class="ui header">
-                IoT Hub
-                <div class="sub header">List of supported IoT protocol scanners for this Host</div>
+                <span locale="locale/iot-hub-title">IoT Hub</span>
+                <div class="sub header" locale="locale/iot-hub-description">List of supported IoT protocol scanners for this Host</div>
             </h3>
         </div>
         <div>
             <table class="ui celled  very basic compact table">
                 <thead>
-                  <tr><th>Protocol Name</th>
-                  <th>Description</th>
-                  <th>Version (Protocol)</th>
-                  <th>Author</th>
-                  <th>Release Date</th>
-                </tr></thead>
+                  <tr>
+                    <th locale="locale/protocol-name">Protocol Name</th>
+                    <th locale="locale/description">Description</th>
+                    <th locale="locale/version-protocol">Version (Protocol)</th>
+                    <th locale="locale/author">Author</th>
+                    <th locale="locale/release-date">Release Date</th>
+                  </tr>
+                </thead>
                 <tbody id="protocolScannerList">
                   <tr>
                     <td data-label="">Home Dynamic v2</td>
@@ -40,6 +43,10 @@
         </div>
     </div>
     <script>
+        applocale.init("../locale/system_info_iot.json", function(){
+            applocale.translate();
+        });
+
         initScannerHandlerList();
         function initScannerHandlerList(){
             $.get("../../system/iot/listScanner", function(data){
@@ -69,4 +76,4 @@
         }
     </script>
 </body>
-</html>
+</html>

+ 54 - 0
web/SystemAO/locale/system_info_iot.json

@@ -0,0 +1,54 @@
+{
+    "author": "tobychui",
+    "version": "1.0",
+    "keys": {
+        "zh-tw": {
+            "name": "繁體中文(台灣)",
+            "fwtitle": "",
+            "strings": {
+                "locale/iot-control-panel-title": "IoT 控制面板",
+                "locale/iot-hub-title": "IoT 中心",
+                "locale/iot-hub-description": "支援的 IoT 協議掃描器清單",
+                "locale/protocol-name": "協議名稱",
+                "locale/description": "描述",
+                "locale/version-protocol": "版本(協議)",
+                "locale/author": "作者",
+                "locale/release-date": "發布日期"
+            },
+            "titles": {},
+            "placeholder": {}
+        },
+        "zh-hk": {
+            "name": "繁體中文(香港)",
+            "fwtitle": "",
+            "strings": {
+                "locale/iot-control-panel-title": "IoT 控制面板",
+                "locale/iot-hub-title": "IoT 中心",
+                "locale/iot-hub-description": "支援的 IoT 協議掃描器清單",
+                "locale/protocol-name": "協議名稱",
+                "locale/description": "描述",
+                "locale/version-protocol": "版本(協議)",
+                "locale/author": "作者",
+                "locale/release-date": "發布日期"
+            },
+            "titles": {},
+            "placeholder": {}
+        },
+        "zh-cn": {
+            "name": "简体中文(简体)",
+            "fwtitle": "",
+            "strings": {
+                "locale/iot-control-panel-title": "IoT 控制面板",
+                "locale/iot-hub-title": "IoT 中心",
+                "locale/iot-hub-description": "支持的 IoT 协议扫描器清单",
+                "locale/protocol-name": "协议名称",
+                "locale/description": "描述",
+                "locale/version-protocol": "版本(协议)",
+                "locale/author": "作者",
+                "locale/release-date": "发布日期"
+            },
+            "titles": {},
+            "placeholder": {}
+        }
+    }
+}