Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a29701b
Add support for Traditional Chinese locale
occultsound Dec 15, 2025
97ad2bc
Change 'zh' to 'tw' for Traditional Chinese locale
occultsound Dec 15, 2025
210f882
Add support for Traditional Chinese language
occultsound Dec 15, 2025
f6e3f1a
Update Chinese locale to traditional and add Taiwan variant
occultsound Dec 15, 2025
76bdfcd
Add Traditional Chinese (Taiwan) translation file
occultsound Dec 15, 2025
07b2dc6
Add Traditional Chinese HelpDoc: AccessLists
occultsound Dec 15, 2025
ccfa848
Add Traditional Chinese help doc for Streams
occultsound Dec 15, 2025
5fb01cc
Fix duplicate locale-bg-BG key, change to locale-zh-TW
occultsound Dec 15, 2025
910b71f
Add remaining Traditional Chinese help documentation files
occultsound Dec 15, 2025
e78163d
Update Traditional Chinese locale with proper formatting
occultsound Dec 15, 2025
06b6ba7
Fix duplicate locale-bg-BG entry, add locale-zh-TW for Traditional Ch…
occultsound Dec 15, 2025
52abe36
Update IntlProvider: change zh-tw import to tw and add tw to specialC…
occultsound Dec 15, 2025
348e689
Fix duplicate locale-bg-BG key and add locale-zh-TW
occultsound Dec 15, 2025
e49c09a
Restore original IntlProvider structure and add Traditional Chinese l…
occultsound Dec 15, 2025
bdcfd8b
Update IntlProvider.tsx to match upstream and add Traditional Chinese…
occultsound Dec 15, 2025
c56649b
Refactor IntlProvider to use createIntl and cache
occultsound Dec 15, 2025
8001c28
Add Traditional Chinese language support
occultsound Dec 15, 2025
525bd79
fix: Correct tw.json format to match project standards
occultsound Dec 17, 2025
7d30d07
Update IntlProvider.tsx
occultsound Dec 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions frontend/check-locales.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const allLocales = [
["zh", "zh-CN"],
["ko", "ko-KR"],
["bg", "bg-BG"],
["tw", "zh-TW"],
];

const ignoreUnused = [
Expand Down
13 changes: 7 additions & 6 deletions frontend/src/locale/IntlProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import langRu from "./lang/ru.json";
import langSk from "./lang/sk.json";
import langVi from "./lang/vi.json";
import langZh from "./lang/zh.json";
import langTw from "./lang/tw.json";
import langKo from "./lang/ko.json";
import langBg from "./lang/bg.json";

Expand All @@ -29,6 +30,7 @@ const localeOptions = [
["sk", "sk-SK", langSk],
["vi", "vi-VN", langVi],
["zh", "zh-CN", langZh],
["tw", "zh-TW", langTw],
["ko", "ko-KR", langKo],
["bg", "bg-BG", langBg],
];
Expand All @@ -44,25 +46,26 @@ const loadMessages = (locale?: string): typeof langList & typeof langEn => {
return Object.assign({}, langList, langEn, localeOptions.find(([code]) => code === thisLocale)?.[2]);
};

const getFlagCodeForLocale = (locale?: string) => {
const getFlagCodeForLocale = (locale?: string) => {
const thisLocale = (locale || "en").slice(0, 2);

// only add to this if your flag is different from the locale code
const specialCases: Record<string, string> = {
ja: "jp", // Japan
zh: "cn", // China
tw: "tw", // Taiwan
vi: "vn", // Vietnam
ko: "kr", // Korea
ko: "kr", // Korea
};

if (specialCases[thisLocale]) {
return specialCases[thisLocale].toUpperCase();
return specialCases[thisLocale]. toUpperCase();
}
return thisLocale.toUpperCase();
};

const getLocale = (short = false) => {
let loc = window.localStorage.getItem("locale");
let loc = window. localStorage.getItem("locale");
if (!loc) {
loc = document.documentElement.lang;
}
Expand Down Expand Up @@ -119,6 +122,4 @@ const T = ({
);
};

console.log("L:", localeOptions);

export { localeOptions, getFlagCodeForLocale, getLocale, createIntl, changeLocale, intl, T };
5 changes: 3 additions & 2 deletions frontend/src/locale/src/HelpDoc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import * as vi from "./vi/index";
import * as zh from "./zh/index";
import * as ko from "./ko/index";
import * as bg from "./bg/index";
import * as tw from "./tw/index";

const items: any = { en, de, ja, sk, zh, pl, ru, it, vi, nl, bg, ko };
const items: any = { en, de, ja, sk, zh, tw, pl, ru, it, vi, nl, bg, ko };

const fallbackLang = "en";

Expand All @@ -20,7 +21,7 @@ export const getHelpFile = (lang: string, section: string): string => {
typeof items[lang] !== "undefined" &&
typeof items[lang][section] !== "undefined"
) {
return items[lang][section].default;
return items[lang][section]. default;
}
// Fallback to English
if (
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/locale/src/HelpDoc/tw/AccessLists.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 什麼是存取清單?

存取清單提供了特定客戶端 IP 位址的黑名單或白名單,以及透過基本 HTTP 驗證對代理主機的驗證。

您可以為一個存取清單設定多個客戶端規則、使用者名稱和密碼,然後將其套用於代理主機。

這對那些沒有內建驗證機制的轉送網路服務,或您想保護其免受未知客戶端存取時最為實用。
21 changes: 21 additions & 0 deletions frontend/src/locale/src/HelpDoc/tw/Certificates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## 憑證說明

### HTTP 憑證

HTTP 驗證的憑證表示 Let's Encrypt 伺服器將嘗試透過 HTTP(而非 HTTPS!)存取您的網域,如果成功,它們將為您核發憑證。

使用此方法時,您必須為您的網域建立一個可透過 HTTP 存取並指向此 Nginx 安裝的代理主機。在取得憑證後,您可以修改該代理主機,使其也使用此憑證處理 HTTPS 連線。然而,為了憑證能夠續約,該代理主機仍需設定為支援 HTTP 存取。

此程序_不支援_萬用字元網域。

### DNS 憑證

DNS 驗證的憑證要求您使用一個 DNS 服務提供者外掛程式。該 DNS 服務提供者將用於在您的網域下建立暫時記錄,隨後 Let's Encrypt 將查詢這些記錄以確認您是網域所有者,如果成功,它們將為您核發憑證。

要求此類憑證前,您無需預先建立代理主機,也無需將您的代理主機設定為支援 HTTP 存取。

此程序_支援_萬用字元網域。

### 自訂憑證

使用此選項上傳您自己的 SSL 憑證,該憑證由您自己的憑證授權單位提供。
7 changes: 7 additions & 0 deletions frontend/src/locale/src/HelpDoc/tw/DeadHosts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 什麼是 404 主機?

404 主機是一個簡單的主機設定,顯示 404 頁面。

當您的網域被列入搜尋引擎,而您想提供一個更好的錯誤頁面,或特別是要告訴搜尋索引器網域頁面不再存在時,這可能很實用。

擁有這種主機的另一個好處是可以追蹤點擊它的日誌並檢視存取來源。
7 changes: 7 additions & 0 deletions frontend/src/locale/src/HelpDoc/tw/ProxyHosts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 什麼是代理主機?

代理主機是您想要轉送網路應用程式的主機。

代理主機可以為沒有 SSL 服務的網路應用程式提供 SSL 服務(選用)。

代理主機是 Nginx Proxy Manager 最常見的用途之一。
5 changes: 5 additions & 0 deletions frontend/src/locale/src/HelpDoc/tw/RedirectionHosts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 什麼是重新導向?

重新導向是將進入網域的請求推送到另一個網域。

使用這種類型主機最常見的原因是當您的網站變更了網域,但您仍然有連結指向舊網域的應用程式。
5 changes: 5 additions & 0 deletions frontend/src/locale/src/HelpDoc/tw/Streams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 什麼是串流?

串流是 Nginx 相對較新的功能,可以直接轉送 TCP/UDP 流量到網路上的另一台電腦。

如果您正在執行遊戲伺服器、FTP 或 SSH 伺服器,這個功能就會很實用。
6 changes: 6 additions & 0 deletions frontend/src/locale/src/HelpDoc/tw/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export * as AccessLists from "./AccessLists.md";
export * as Certificates from "./Certificates.md";
export * as DeadHosts from "./DeadHosts.md";
export * as ProxyHosts from "./ProxyHosts.md";
export * as RedirectionHosts from "./RedirectionHosts.md";
export * as Streams from "./Streams.md";
5 changes: 4 additions & 1 deletion frontend/src/locale/src/lang-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@
},
"locale-bg-BG": {
"defaultMessage": "Български"
},
"locale-zh-TW": {
"defaultMessage": "繁體中文"
}
}
}
Loading