Browse Source

Added more localization

Toby Chui 6 ngày trước cách đây
mục cha
commit
626c406aa4

BIN
documents/icon/240px-Squircle2.svg.png


+ 84 - 0
web/SystemAO/locale/default_opener_settings.json

@@ -0,0 +1,84 @@
+{
+    "author": "GitHub Copilot",
+    "version": "1.0",
+    "keys": {
+        "zh-tw": {
+            "name": "繁體中文(台灣)",
+            "fontFamily": "\"Microsoft JhengHei\",\"SimHei\", \"Apple LiGothic Medium\", \"STHeiti\"",
+            "strings": {
+                "defaultOpener/Title": "預設開啟模組",
+                "defaultOpener/Subtitle": "管理用於開啟各種副檔名的預設模組",
+                "defaultOpener/Updated": "預設開啟模組已更新",
+                "defaultOpener/TryAgain": "請再次嘗試開啟檔案以檢查是否正常",
+                "defaultOpener/FileExtension": "副檔名",
+                "defaultOpener/CurrentDefault": "目前預設",
+                "defaultOpener/ModifyDefault": "修改預設(更改即儲存)"
+            }
+        },
+        "zh-hk": {
+            "name": "繁體中文(香港)",
+            "fontFamily": "\"Microsoft JhengHei\",\"SimHei\", \"Apple LiGothic Medium\", \"STHeiti\"",
+            "strings": {
+                "defaultOpener/Title": "預設開啟模組",
+                "defaultOpener/Subtitle": "管理用於開啟各種副檔名的預設模組",
+                "defaultOpener/Updated": "預設開啟模組已更新",
+                "defaultOpener/TryAgain": "請再次嘗試開啟檔案以檢查是否正常",
+                "defaultOpener/FileExtension": "副檔名",
+                "defaultOpener/CurrentDefault": "目前預設",
+                "defaultOpener/ModifyDefault": "修改預設(更改即儲存)"
+            }
+        },
+        "zh-cn": {
+            "name": "简体中文",
+            "fontFamily": "\"Microsoft YaHei\",\"SimHei\", \"PingFangSC-Medium\", \"STHeiti\"",
+            "strings": {
+                "defaultOpener/Title": "默认打开模块",
+                "defaultOpener/Subtitle": "管理用于打开各种扩展名的默认模块",
+                "defaultOpener/Updated": "默认打开模块已更新",
+                "defaultOpener/TryAgain": "请再次尝试打开文件以检查是否正常",
+                "defaultOpener/FileExtension": "扩展名",
+                "defaultOpener/CurrentDefault": "当前默认",
+                "defaultOpener/ModifyDefault": "修改默认(更改即保存)"
+            }
+        },
+        "en-us": {
+            "name": "English (US)",
+            "fontFamily": "Arial, Helvetica, sans-serif",
+            "strings": {
+                "defaultOpener/Title": "Default Opening Module",
+                "defaultOpener/Subtitle": "Manage your default modules to open files with given extensions",
+                "defaultOpener/Updated": "Default Opening Module Updated",
+                "defaultOpener/TryAgain": "Try to open your file again and see if it is working",
+                "defaultOpener/FileExtension": "File Extension",
+                "defaultOpener/CurrentDefault": "Current Default",
+                "defaultOpener/ModifyDefault": "Modify Default (Save on Change)"
+            }
+        },
+        "ja-jp": {
+            "name": "日本語",
+            "fontFamily": "\"Meiryo UI\", \"Arial Unicode MS\", \"Hiragino Kaku Gothic Pro\"",
+            "strings": {
+                "defaultOpener/Title": "デフォルトのオープンモジュール",
+                "defaultOpener/Subtitle": "拡張子ごとにファイルを開くデフォルトモジュールを管理します",
+                "defaultOpener/Updated": "デフォルトのオープンモジュールが更新されました",
+                "defaultOpener/TryAgain": "もう一度ファイルを開いて動作を確認してください",
+                "defaultOpener/FileExtension": "拡張子",
+                "defaultOpener/CurrentDefault": "現在のデフォルト",
+                "defaultOpener/ModifyDefault": "デフォルトを変更(変更時に保存)"
+            }
+        },
+        "ko_kr": {
+            "name": "한국어",
+            "fontFamily": "\"Microsoft JhengHei\",\"SimHei\", \"Apple LiGothic Medium\", \"STHeiti\"",
+            "strings": {
+                "defaultOpener/Title": "기본 열기 모듈",
+                "defaultOpener/Subtitle": "확장자별로 파일을 열 기본 모듈을 관리합니다",
+                "defaultOpener/Updated": "기본 열기 모듈이 업데이트되었습니다",
+                "defaultOpener/TryAgain": "파일을 다시 열어 정상 동작하는지 확인하세요",
+                "defaultOpener/FileExtension": "확장자",
+                "defaultOpener/CurrentDefault": "현재 기본값",
+                "defaultOpener/ModifyDefault": "기본값 수정(변경 시 저장)"
+            }
+        }
+    }
+}

+ 126 - 0
web/SystemAO/locale/subservices_setting.json

@@ -0,0 +1,126 @@
+{
+    "author": "GitHub Copilot",
+    "version": "1.0",
+    "keys": {
+        "zh-tw": {
+            "name": "繁體中文(台灣)",
+            "fontFamily": "\"Microsoft JhengHei\",\"SimHei\", \"Apple LiGothic Medium\", \"STHeiti\"",
+            "strings": {
+                "subservices/Title": "子服務管理",
+                "subservices/Subtitle": "使用子服務將服務串連在一起",
+                "subservices/WhatIs": "什麼是子服務?",
+                "subservices/Desc": "子服務是 ArOZ Online 模組的一種,並非系統核心內建,但可像核心模組一樣運作。它由 ArOZ Online Core 內建的反向代理提供支援,因此能像內建模組一樣提供網頁內容。與無法關閉的核心模組不同,子服務可隨時關閉以節省資源。",
+                "subservices/Running": "運行中服務",
+                "subservices/Module": "對應模組",
+                "subservices/Port": "埠號",
+                "subservices/ProxyPath": "反向代理路徑",
+                "subservices/Executable": "執行檔 (程序 ID)",
+                "subservices/Action": "操作",
+                "subservices/Disable": "停用",
+                "subservices/Disabled": "已停用服務",
+                "subservices/ServiceName": "服務名稱",
+                "subservices/Start": "啟動"
+            }
+        },
+        "zh-hk": {
+            "name": "繁體中文(香港)",
+            "fontFamily": "\"Microsoft JhengHei\",\"SimHei\", \"Apple LiGothic Medium\", \"STHeiti\"",
+            "strings": {
+                "subservices/Title": "子服務管理",
+                "subservices/Subtitle": "使用子服務將服務串連在一起",
+                "subservices/WhatIs": "什麼是子服務?",
+                "subservices/Desc": "子服務是 ArOZ Online 模組的一種,並非系統核心內建,但可像核心模組一樣運作。它由 ArOZ Online Core 內建的反向代理提供支援,因此能像內建模組一樣提供網頁內容。與無法關閉的核心模組不同,子服務可隨時關閉以節省資源。",
+                "subservices/Running": "運行中服務",
+                "subservices/Module": "對應模組",
+                "subservices/Port": "埠號",
+                "subservices/ProxyPath": "反向代理路徑",
+                "subservices/Executable": "執行檔 (程序 ID)",
+                "subservices/Action": "操作",
+                "subservices/Disable": "停用",
+                "subservices/Disabled": "已停用服務",
+                "subservices/ServiceName": "服務名稱",
+                "subservices/Start": "啟動"
+            }
+        },
+        "zh-cn": {
+            "name": "简体中文",
+            "fontFamily": "\"Microsoft YaHei\",\"SimHei\", \"PingFangSC-Medium\", \"STHeiti\"",
+            "strings": {
+                "subservices/Title": "子服务管理",
+                "subservices/Subtitle": "使用子服务将服务串联在一起",
+                "subservices/WhatIs": "什么是子服务?",
+                "subservices/Desc": "子服务是 ArOZ Online 模块的一种,并非系统核心内建,但可像核心模块一样运作。它由 ArOZ Online Core 内建的反向代理提供支持,因此能像内建模块一样提供网页内容。与无法关闭的核心模块不同,子服务可随时关闭以节省资源。",
+                "subservices/Running": "运行中服务",
+                "subservices/Module": "对应模块",
+                "subservices/Port": "端口",
+                "subservices/ProxyPath": "反向代理路径",
+                "subservices/Executable": "可执行文件 (进程 ID)",
+                "subservices/Action": "操作",
+                "subservices/Disable": "禁用",
+                "subservices/Disabled": "已禁用服务",
+                "subservices/ServiceName": "服务名称",
+                "subservices/Start": "启动"
+            }
+        },
+        "en-us": {
+            "name": "English (US)",
+            "fontFamily": "Arial, Helvetica, sans-serif",
+            "strings": {
+                "subservices/Title": "Manage Subservice",
+                "subservices/Subtitle": "Glue services together using subservices",
+                "subservices/WhatIs": "What is Subservice?",
+                "subservices/Desc": "Subservice is one type of ArOZ Online Module that is not built into the system core but acts like one. It is powered by a reverse proxy built into the ArOZ Online Core so it can serve web content just like a built-in module. Unlike the core modules that cannot be toggled off, you can switch subservices off to save power when needed.",
+                "subservices/Running": "Running Services",
+                "subservices/Module": "Corresponding Module",
+                "subservices/Port": "Port",
+                "subservices/ProxyPath": "Reverse Proxy Path",
+                "subservices/Executable": "Executable (Process ID)",
+                "subservices/Action": "Action",
+                "subservices/Disable": "DISABLE",
+                "subservices/Disabled": "Disabled Services",
+                "subservices/ServiceName": "Service Name",
+                "subservices/Start": "Start"
+            }
+        },
+        "ja-jp": {
+            "name": "日本語",
+            "fontFamily": "\"Meiryo UI\", \"Arial Unicode MS\", \"Hiragino Kaku Gothic Pro\"",
+            "strings": {
+                "subservices/Title": "サブサービス管理",
+                "subservices/Subtitle": "サブサービスでサービスを連携",
+                "subservices/WhatIs": "サブサービスとは?",
+                "subservices/Desc": "サブサービスは、ArOZ Online モジュールの一種で、システムコアに組み込まれていませんが、コアモジュールのように動作します。ArOZ Online Core に組み込まれたリバースプロキシによって動作し、コアモジュールと同様にウェブコンテンツを提供できます。コアモジュールと異なり、サブサービスは必要に応じてオフにしてリソースを節約できます。",
+                "subservices/Running": "稼働中のサービス",
+                "subservices/Module": "対応モジュール",
+                "subservices/Port": "ポート",
+                "subservices/ProxyPath": "リバースプロキシパス",
+                "subservices/Executable": "実行ファイル (プロセスID)",
+                "subservices/Action": "操作",
+                "subservices/Disable": "無効化",
+                "subservices/Disabled": "無効化されたサービス",
+                "subservices/ServiceName": "サービス名",
+                "subservices/Start": "開始"
+            }
+        },
+        "ko_kr": {
+            "name": "한국어",
+            "fontFamily": "\"Microsoft JhengHei\",\"SimHei\", \"Apple LiGothic Medium\", \"STHeiti\"",
+            "strings": {
+                "subservices/Title": "서브서비스 관리",
+                "subservices/Subtitle": "서브서비스로 서비스를 연결합니다",
+                "subservices/WhatIs": "서브서비스란?",
+                "subservices/Desc": "서브서비스는 ArOZ Online 모듈의 한 종류로, 시스템 코어에 내장되어 있지 않지만 코어 모듈처럼 동작합니다. ArOZ Online Core에 내장된 리버스 프록시로 구동되어 코어 모듈과 같이 웹 콘텐츠를 제공합니다. 코어 모듈과 달리 서브서비스는 필요에 따라 끌 수 있어 자원을 절약할 수 있습니다.",
+                "subservices/Running": "실행 중인 서비스",
+                "subservices/Module": "해당 모듈",
+                "subservices/Port": "포트",
+                "subservices/ProxyPath": "리버스 프록시 경로",
+                "subservices/Executable": "실행 파일 (프로세스 ID)",
+                "subservices/Action": "동작",
+                "subservices/Disable": "비활성화",
+                "subservices/Disabled": "비활성화된 서비스",
+                "subservices/ServiceName": "서비스 이름",
+                "subservices/Start": "시작"
+            }
+        }
+    }
+}

+ 28 - 9
web/SystemAO/modules/defaultOpener.html

@@ -7,6 +7,7 @@
         <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>
         <!-- <script type="text/javascript" src="../../script/ao_module.js"></script> -->
     </head>
     <body>
@@ -15,8 +16,8 @@
                 <div class="ui header">
                     <i class="external icon"></i>
                     <div class="content">
-                        Default Opening Module
-                        <div class="sub header">Manage your default modules to open files with given extensions</div>
+                        <span locale="defaultOpener/Title">Default Opening Module</span>
+                        <div class="sub header"><span locale="defaultOpener/Subtitle">Manage your default modules to open files with given extensions</span></div>
                     </div>
                 </div>
             </div>
@@ -24,17 +25,19 @@
                 <i class="checkmark icon"></i>
                 <div class="content">
                     <div class="header">
-                    Default Opening Module Updated
+                        <span locale="defaultOpener/Updated">Default Opening Module Updated</span>
                     </div>
-                    <p>Try to open your file again and see if it is working</p>
+                    <p><span locale="defaultOpener/TryAgain">Try to open your file again and see if it is working</span></p>
                 </div>
             </div>
             <table class="ui celled table">
                 <thead>
-                  <tr><th>File Extension</th>
-                  <th>Current Default </th>
-                  <th>Modify Default (Save on Change)</th>
-                </tr></thead>
+                    <tr>
+                        <th locale="defaultOpener/FileExtension">File Extension</th>
+                        <th locale="defaultOpener/CurrentDefault">Current Default</th>
+                        <th locale="defaultOpener/ModifyDefault">Modify Default (Save on Change)</th>
+                    </tr>
+                </thead>
                 <tbody id="defaultOpenerList">
               
                 </tbody>
@@ -42,7 +45,7 @@
         </div>
         <script>
             loadDefaultOpener();
-
+            
             function loadDefaultOpener(){
                 $("#defaultOpenerList").html("");
                 $.ajax({
@@ -102,6 +105,22 @@
                     $("#msgbox").stop().finish().slideDown('fast').delay(5000).slideUp('fast');
                 }
             }
+
+            $(document).ready(function(){
+                if (applocale){
+                    //Applocale found. Do localization
+                    applocale.init("../locale/default_opener_settings.json", function(){
+                        applocale.translate();
+                    });
+                }else{
+                    //Applocale not found. Is this a trim down version of ArozOS?
+                    applocale = {
+                        getString: function(key, original){
+                            return original;
+                        }
+                    }
+                }
+            });
         </script>
     </body>
 </html>

+ 39 - 30
web/SystemAO/modules/subservices.html

@@ -7,6 +7,7 @@
         <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>
         <!-- <script type="text/javascript" src="../../script/ao_module.js"></script> -->
     </head>
     <body>
@@ -16,55 +17,47 @@
                 <div class="ui header">
                     <i class="server icon"></i>
                     <div class="content">
-                        Manage Subservice
-                        <div class="sub header">Glue services together using subservices</div>
+                        <span locale="subservices/Title">Manage Subservice</span>
+                        <div class="sub header"><span locale="subservices/Subtitle">Glue services together using subservices</span></div>
                     </div>
                 </div>
                 <div class="ui accordion">
                     <div class="title">
                         <i class="dropdown icon"></i>
-                        What is Subservice?
+                        <span locale="subservices/WhatIs">What is Subservice?</span>
                     </div>
                     <div class="content">
-                        <p class="transition hidden">Subservice is one type of ArOZ Online Module that is not build in to the system core but act like one. It is powered by reverse proxy build into the ArOZ Online Core so it can serve web content just like a build in module. Unlike the core modules that cannot be toggle off, you can switch subservices off to save power when needed.</p>
+                        <p class="transition hidden"><span locale="subservices/Desc">Subservice is one type of ArOZ Online Module that is not build in to the system core but act like one. It is powered by reverse proxy build into the ArOZ Online Core so it can serve web content just like a build in module. Unlike the core modules that cannot be toggle off, you can switch subservices off to save power when needed.</span></p>
                     </div>
                 </div>
             </div>
-            <h4>Running Services</h4>
+            <h4 locale="subservices/Running">Running Services</h4>
             <table class="ui celled striped table">
                 <thead>
                     <tr>
-                        <th>
-                            Corresponding Module
-                        </th>
-                        <th>
-                            Port
-                        </th>
-                        <th>
-                            Reverse Proxy Path
-                        </th>
-                        <th>
-                            Executable (Process ID)
-                        </th>
-                        <th>
-                            Action
-                        </th>
+                        <th locale="subservices/Module">Corresponding Module</th>
+                        <th locale="subservices/Port">Port</th>
+                        <th locale="subservices/ProxyPath">Reverse Proxy Path</th>
+                        <th locale="subservices/Executable">Executable (Process ID)</th>
+                        <th locale="subservices/Action">Action</th>
                     </tr>
                 </thead>
                 <tbody id="sslist">
                    
                 </tbody>
             </table>
-            <h4>Disabled Services</h4>
-            <table class="ui celled table">
-                <thead>
-                  <tr><th>Service Name</th>
-                  <th>Executable</th>
-                  <th>Action</th>
-                </tr></thead>
-                <tbody id="disServiceList">
+                        <h4 locale="subservices/Disabled">Disabled Services</h4>
+                        <table class="ui celled table">
+                                <thead>
+                                    <tr>
+                                        <th locale="subservices/ServiceName">Service Name</th>
+                                        <th locale="subservices/Executable">Executable</th>
+                                        <th locale="subservices/Action">Action</th>
+                                    </tr>
+                                </thead>
+                                <tbody id="disServiceList">
                
-                </tbody>
+                                </tbody>
         </div>
         <script>
             $('.ui.accordion').accordion();
@@ -113,7 +106,7 @@
                             $("#disServiceList").append(` <tr>
                                 <td>${thisDisabledService.ServiceDir}</td>
                                 <td>${thisDisabledService.Path}</td>
-                                <td><button onclick="start(this);" dir="${thisDisabledService.ServiceDir}" class="ui positive tiny button">Start</button></td>
+                                <td><button onclick="start(this);" dir="${thisDisabledService.ServiceDir}" class="ui positive tiny button"><span locale="subservices/Start">Start</span></button></td>
                             </tr>`);
                         }
                     }
@@ -158,6 +151,22 @@
                     }
                 });
             }
+
+            $(document).ready(function(){
+                if (applocale){
+                    //Applocale found. Do localization
+                    applocale.init("../locale/subservices_setting.json", function(){
+                        applocale.translate();
+                    });
+                }else{
+                    //App locale not found. Is this a trim down version of ArozOS?
+                    applocale = {
+                        getString: function(key, original){
+                            return original;
+                        }
+                    }
+                }
+            });
         </script>
     </body>
 </html>