Skip to content

Commit b071080

Browse files
committed
v1.2.0: i18n — English source strings with bundled zh_TW translation
- Wrap all UI strings in __()/esc_html__() with text domain perf-hardening; plugin Description header now English - Add languages/: POT template, zh_TW .po/.mo and WP 6.5+ .l10n.php - Load textdomain via load_plugin_textdomain, or load_muplugin_textdomain when running from mu-plugins - Verified on Docker WordPress 7.0.2: settings page renders English under en_US and Traditional Chinese under zh_TW; plugin name and description translate on the plugins list
1 parent 5fe691f commit b071080

8 files changed

Lines changed: 588 additions & 46 deletions

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
本專案遵循 [Keep a Changelog](https://keepachangelog.com/zh-TW/1.1.0/) 格式,
44
版本號採用 [語意化版本](https://semver.org/lang/zh-TW/)
55

6+
## [1.2.0] - 2026-07-31
7+
8+
### 新增
9+
10+
- 字串國際化:介面改以英文為源語言(text domain `perf-hardening`),
11+
`languages/` 內附繁體中文(zh_TW)翻譯(.po / .mo / .l10n.php)與 POT 樣板
12+
- 依安裝模式自動選用 `load_plugin_textdomain``load_muplugin_textdomain`
13+
mu-plugin 模式如需翻譯,將 `languages/` 一併放入 `mu-plugins/`
14+
- 外掛名稱與描述亦隨語系翻譯(於 Docker WordPress 7.0.2 en_US 與 zh_TW 實測)
15+
616
## [1.1.0] - 2026-07-31
717

818
### 新增

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ sudo -u www-data wp rewrite flush --path=/var/www/html
3838

3939
mu-plugin 模式同樣有「設定 → 效能強化」後台頁可用。兩種方式同時安裝時只有先載入的 mu-plugin 版生效。
4040

41+
介面源語言為英文,`languages/` 內附繁體中文(zh_TW)翻譯,依站台語系自動切換。mu-plugin 模式如需翻譯,請將 `languages/` 資料夾一併放入 `mu-plugins/`
42+
4143
若站台使用頁面快取,安裝後請一併清除。
4244

4345
## 設定
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
return ['domain'=>'perf-hardening','plural-forms'=>'nplurals=1; plural=0;','language'=>'zh_TW','project-id-version'=>'Performance Hardening 1.2.0','pot-creation-date'=>'2026-07-31T03:02:52+00:00','po-revision-date'=>'2026-07-31T03:10:00+00:00','x-generator'=>'WP-CLI 2.12.0','messages'=>['Performance Hardening'=>'效能強化','Tames the most expensive WordPress endpoints: search table scans, archive SQL_CALC_FOUND_ROWS, low-value feeds, oEmbed and XML-RPC, with CDN-friendly cache headers.'=>'收斂 WordPress 高成本端點:站內搜尋全表掃描、封存頁 SQL_CALC_FOUND_ROWS、低價值 Feed、oEmbed、XML-RPC,並為 CDN 提供正確的快取標頭。','Feature switches'=>'功能開關','Search hardening'=>'站內搜尋防護','Filter junk search probes and narrow the query scope'=>'過濾垃圾關鍵字並限縮查詢範圍','Archive query slimming'=>'封存頁查詢瘦身','Drop SQL_CALC_FOUND_ROWS on tag, author and date archives'=>'標籤/作者/日期封存頁關閉 SQL_CALC_FOUND_ROWS','Cache & robots headers'=>'快取與 robots 標頭','Send Cache-Control and X-Robots-Tag per endpoint type for feeds, search, tag pages and 404s'=>'Feed、搜尋頁、標籤頁、404 依端點類型送出 Cache-Control 與 X-Robots-Tag','Author page hardening'=>'作者頁收斂','Author pages get noindex, author feeds return 410 and robots.txt blocks /author/. Turn off on sites that want author archives exposed'=>'作者頁 noindex、author feed 回 410、robots.txt 封鎖 /author/。想保留作者頁曝光的站台請關閉','Heartbeat tuning'=>'Heartbeat 調頻','Slow down admin polling and disable the frontend Heartbeat'=>'降低後台輪詢頻率並停用前台 Heartbeat','Disable oEmbed'=>'停用 oEmbed','Remove the /embed/ routes and oEmbed endpoints; rewrite rules rebuild automatically after toggling'=>'移除 /embed/ 路由與 oEmbed 端點;切換後自動重建 rewrite rules','Disable XML-RPC'=>'停用 XML-RPC','Including pingback'=>'含 pingback','Frontend external request throttle'=>'前台外部請求節流','Cap external HTTP timeouts on frontend requests from logged-out visitors'=>'未登入訪客的前台請求套用外部 HTTP 逾時上限','Manage robots.txt'=>'接管 robots.txt','Only takes effect when no physical robots.txt exists in the site root'=>'僅在根目錄無實體 robots.txt 時生效','Block REST user enumeration'=>'封鎖 REST 使用者列舉','Logged-out visitors cannot access /wp/v2/users'=>'未登入者無法存取 /wp/v2/users','Search'=>'搜尋','Minimum keyword length'=>'關鍵字最短長度','Maximum keyword length'=>'關鍵字最長長度','Word count limit'=>'詞數上限','Whitespace-separated words; 0 disables'=>'空白分隔詞數,0 停用','Result pages limit'=>'結果頁數上限','0 disables'=>'0 停用','Results per page'=>'每頁筆數','Match titles and excerpts only'=>'只比對標題與摘要','Requires WP 6.2+. Cuts scan cost sharply but misses keywords that appear only in post content'=>'需 WP 6.2+。大幅降低掃描成本,但會漏掉只出現在內文的關鍵字','Non-CJK long string threshold'=>'非中日韓長字串門檻','Strings longer than this without CJK characters are treated as junk probes; 0 disables'=>'超過此長度且不含中日韓字元視為垃圾探測,0 停用','Archives & feeds'=>'封存頁與 Feed','Archive posts per page'=>'封存頁每頁筆數','Thin tag threshold'=>'薄內容標籤門檻','Tag pages with this many posts or fewer are marked noindex; 0 disables'=>'文章數低於或等於此值的標籤頁標記 noindex,0 停用','Deep pagination threshold'=>'深層分頁門檻','Pages beyond this number are marked noindex; 0 disables'=>'分頁超過此頁數標記 noindex,0 停用','Feed policy'=>'Feed 策略','Check which feed paths your content partners subscribe to before deploying'=>'部署前請先確認合作夥伴訂閱的 Feed 路徑','Remove extra feed discovery links'=>'移除額外 Feed discovery link','Also removes category feed discovery links; existing feed URLs keep working'=>'同時移除分類 Feed 的 discovery link,既有 Feed URL 不受影響','Tag feed items'=>'Tag feed 項目數','0 leaves the default untouched'=>'0 表示不調整','External feed cache hours'=>'外部 Feed 快取時數','Cache lifetime for fetch_feed() results'=>'fetch_feed() 抓取結果的快取時間','Other'=>'其他','Frontend external timeout (seconds)'=>'前台外部請求逾時(秒)','Cap on external HTTP calls during frontend requests from logged-out visitors'=>'未登入訪客的前台請求,外部 HTTP 呼叫逾時上限','Editor Heartbeat interval (seconds)'=>'編輯畫面 Heartbeat 間隔(秒)','List screen Heartbeat interval (seconds)'=>'列表畫面 Heartbeat 間隔(秒)','Settings saved. Cached pages will reflect changes after the cache expires or is purged.'=>'設定已儲存。快取中的頁面需待快取過期或手動清除後才會反映。','Priority: %1$s constants in %2$s > settings on this page > defaults. Fields pinned by a defined constant are locked.'=>'優先序:%2$s 的 %1$s 常數 > 此處設定 > 預設值。已定義常數的欄位會顯示為鎖定。','cache — keep all feeds, only add cache headers'=>'cache — 全部 Feed 保留,僅加快取標頭','strict — author / search / comment feeds return 410 (default)'=>'strict — author / search / comment feed 回 410(預設)','off — keep only the main feed and category feeds'=>'off — 僅保留主 Feed 與分類 Feed','Locked by %s; remove the constant from wp-config.php to edit it here.'=>'已由 %s 固定,移除 wp-config.php 中該常數後才可在此調整。','Save Settings'=>'儲存設定']];

languages/perf-hardening-zh_TW.mo

6.44 KB
Binary file not shown.

languages/perf-hardening-zh_TW.po

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
# Traditional Chinese (Taiwan) translation for Performance Hardening.
2+
# Copyright (C) 2026 ivanusto
3+
# This file is distributed under the GPL-2.0-or-later.
4+
msgid ""
5+
msgstr ""
6+
"Project-Id-Version: Performance Hardening 1.2.0\n"
7+
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/perf-hardening\n"
8+
"Last-Translator: ivanusto\n"
9+
"Language-Team: Chinese (Taiwan)\n"
10+
"Language: zh_TW\n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: 8bit\n"
14+
"Plural-Forms: nplurals=1; plural=0;\n"
15+
"POT-Creation-Date: 2026-07-31T03:02:52+00:00\n"
16+
"PO-Revision-Date: 2026-07-31T03:10:00+00:00\n"
17+
"X-Generator: WP-CLI 2.12.0\n"
18+
"X-Domain: perf-hardening\n"
19+
20+
#. Plugin Name of the plugin
21+
msgid "Performance Hardening"
22+
msgstr "效能強化"
23+
24+
#. Description of the plugin
25+
msgid "Tames the most expensive WordPress endpoints: search table scans, archive SQL_CALC_FOUND_ROWS, low-value feeds, oEmbed and XML-RPC, with CDN-friendly cache headers."
26+
msgstr "收斂 WordPress 高成本端點:站內搜尋全表掃描、封存頁 SQL_CALC_FOUND_ROWS、低價值 Feed、oEmbed、XML-RPC,並為 CDN 提供正確的快取標頭。"
27+
28+
msgid "Feature switches"
29+
msgstr "功能開關"
30+
31+
msgid "Search hardening"
32+
msgstr "站內搜尋防護"
33+
34+
msgid "Filter junk search probes and narrow the query scope"
35+
msgstr "過濾垃圾關鍵字並限縮查詢範圍"
36+
37+
msgid "Archive query slimming"
38+
msgstr "封存頁查詢瘦身"
39+
40+
msgid "Drop SQL_CALC_FOUND_ROWS on tag, author and date archives"
41+
msgstr "標籤/作者/日期封存頁關閉 SQL_CALC_FOUND_ROWS"
42+
43+
msgid "Cache & robots headers"
44+
msgstr "快取與 robots 標頭"
45+
46+
msgid "Send Cache-Control and X-Robots-Tag per endpoint type for feeds, search, tag pages and 404s"
47+
msgstr "Feed、搜尋頁、標籤頁、404 依端點類型送出 Cache-Control 與 X-Robots-Tag"
48+
49+
msgid "Author page hardening"
50+
msgstr "作者頁收斂"
51+
52+
msgid "Author pages get noindex, author feeds return 410 and robots.txt blocks /author/. Turn off on sites that want author archives exposed"
53+
msgstr "作者頁 noindex、author feed 回 410、robots.txt 封鎖 /author/。想保留作者頁曝光的站台請關閉"
54+
55+
msgid "Heartbeat tuning"
56+
msgstr "Heartbeat 調頻"
57+
58+
msgid "Slow down admin polling and disable the frontend Heartbeat"
59+
msgstr "降低後台輪詢頻率並停用前台 Heartbeat"
60+
61+
msgid "Disable oEmbed"
62+
msgstr "停用 oEmbed"
63+
64+
msgid "Remove the /embed/ routes and oEmbed endpoints; rewrite rules rebuild automatically after toggling"
65+
msgstr "移除 /embed/ 路由與 oEmbed 端點;切換後自動重建 rewrite rules"
66+
67+
msgid "Disable XML-RPC"
68+
msgstr "停用 XML-RPC"
69+
70+
msgid "Including pingback"
71+
msgstr "含 pingback"
72+
73+
msgid "Frontend external request throttle"
74+
msgstr "前台外部請求節流"
75+
76+
msgid "Cap external HTTP timeouts on frontend requests from logged-out visitors"
77+
msgstr "未登入訪客的前台請求套用外部 HTTP 逾時上限"
78+
79+
msgid "Manage robots.txt"
80+
msgstr "接管 robots.txt"
81+
82+
msgid "Only takes effect when no physical robots.txt exists in the site root"
83+
msgstr "僅在根目錄無實體 robots.txt 時生效"
84+
85+
msgid "Block REST user enumeration"
86+
msgstr "封鎖 REST 使用者列舉"
87+
88+
msgid "Logged-out visitors cannot access /wp/v2/users"
89+
msgstr "未登入者無法存取 /wp/v2/users"
90+
91+
msgid "Search"
92+
msgstr "搜尋"
93+
94+
msgid "Minimum keyword length"
95+
msgstr "關鍵字最短長度"
96+
97+
msgid "Maximum keyword length"
98+
msgstr "關鍵字最長長度"
99+
100+
msgid "Word count limit"
101+
msgstr "詞數上限"
102+
103+
msgid "Whitespace-separated words; 0 disables"
104+
msgstr "空白分隔詞數,0 停用"
105+
106+
msgid "Result pages limit"
107+
msgstr "結果頁數上限"
108+
109+
msgid "0 disables"
110+
msgstr "0 停用"
111+
112+
msgid "Results per page"
113+
msgstr "每頁筆數"
114+
115+
msgid "Match titles and excerpts only"
116+
msgstr "只比對標題與摘要"
117+
118+
msgid "Requires WP 6.2+. Cuts scan cost sharply but misses keywords that appear only in post content"
119+
msgstr "需 WP 6.2+。大幅降低掃描成本,但會漏掉只出現在內文的關鍵字"
120+
121+
msgid "Non-CJK long string threshold"
122+
msgstr "非中日韓長字串門檻"
123+
124+
msgid "Strings longer than this without CJK characters are treated as junk probes; 0 disables"
125+
msgstr "超過此長度且不含中日韓字元視為垃圾探測,0 停用"
126+
127+
msgid "Archives & feeds"
128+
msgstr "封存頁與 Feed"
129+
130+
msgid "Archive posts per page"
131+
msgstr "封存頁每頁筆數"
132+
133+
msgid "Thin tag threshold"
134+
msgstr "薄內容標籤門檻"
135+
136+
msgid "Tag pages with this many posts or fewer are marked noindex; 0 disables"
137+
msgstr "文章數低於或等於此值的標籤頁標記 noindex,0 停用"
138+
139+
msgid "Deep pagination threshold"
140+
msgstr "深層分頁門檻"
141+
142+
msgid "Pages beyond this number are marked noindex; 0 disables"
143+
msgstr "分頁超過此頁數標記 noindex,0 停用"
144+
145+
msgid "Feed policy"
146+
msgstr "Feed 策略"
147+
148+
msgid "Check which feed paths your content partners subscribe to before deploying"
149+
msgstr "部署前請先確認合作夥伴訂閱的 Feed 路徑"
150+
151+
msgid "Remove extra feed discovery links"
152+
msgstr "移除額外 Feed discovery link"
153+
154+
msgid "Also removes category feed discovery links; existing feed URLs keep working"
155+
msgstr "同時移除分類 Feed 的 discovery link,既有 Feed URL 不受影響"
156+
157+
msgid "Tag feed items"
158+
msgstr "Tag feed 項目數"
159+
160+
msgid "0 leaves the default untouched"
161+
msgstr "0 表示不調整"
162+
163+
msgid "External feed cache hours"
164+
msgstr "外部 Feed 快取時數"
165+
166+
msgid "Cache lifetime for fetch_feed() results"
167+
msgstr "fetch_feed() 抓取結果的快取時間"
168+
169+
msgid "Other"
170+
msgstr "其他"
171+
172+
msgid "Frontend external timeout (seconds)"
173+
msgstr "前台外部請求逾時(秒)"
174+
175+
msgid "Cap on external HTTP calls during frontend requests from logged-out visitors"
176+
msgstr "未登入訪客的前台請求,外部 HTTP 呼叫逾時上限"
177+
178+
msgid "Editor Heartbeat interval (seconds)"
179+
msgstr "編輯畫面 Heartbeat 間隔(秒)"
180+
181+
msgid "List screen Heartbeat interval (seconds)"
182+
msgstr "列表畫面 Heartbeat 間隔(秒)"
183+
184+
msgid "Settings saved. Cached pages will reflect changes after the cache expires or is purged."
185+
msgstr "設定已儲存。快取中的頁面需待快取過期或手動清除後才會反映。"
186+
187+
#. translators: 1: PH_* 2: wp-config.php
188+
#, php-format
189+
msgid "Priority: %1$s constants in %2$s > settings on this page > defaults. Fields pinned by a defined constant are locked."
190+
msgstr "優先序:%2$s 的 %1$s 常數 > 此處設定 > 預設值。已定義常數的欄位會顯示為鎖定。"
191+
192+
msgid "cache — keep all feeds, only add cache headers"
193+
msgstr "cache — 全部 Feed 保留,僅加快取標頭"
194+
195+
msgid "strict — author / search / comment feeds return 410 (default)"
196+
msgstr "strict — author / search / comment feed 回 410(預設)"
197+
198+
msgid "off — keep only the main feed and category feeds"
199+
msgstr "off — 僅保留主 Feed 與分類 Feed"
200+
201+
#. translators: %s: constant name, e.g. PH_SEARCH_HARDENING
202+
#, php-format
203+
msgid "Locked by %s; remove the constant from wp-config.php to edit it here."
204+
msgstr "已由 %s 固定,移除 wp-config.php 中該常數後才可在此調整。"
205+
206+
msgid "Save Settings"
207+
msgstr "儲存設定"

0 commit comments

Comments
 (0)