Skip to content

i18n(zh-CN): Settings › General - #131

Merged
X4Applegate merged 1 commit into
X4Applegate:mainfrom
chongfenglaosiji:i18n/zh-CN-settings-general
Oct 10, 2026
Merged

X4Applegate merged 1 commit into
X4Applegate:mainfrom
chongfenglaosiji:i18n/zh-CN-settings-general

Conversation

@chongfenglaosiji

@chongfenglaosiji chongfenglaosiji commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

i18n(zh-CN): Settings › General

What & why

Continues the zh-CN catalog with the batch you flagged in #130: the
Settings › General page, as a data-only change.

Data-only: web/i18n/zh-CN.json is the only file touched. No Go, template or
JavaScript edits.

Scope

44 new keys — exactly what v2.63.0 added under these prefixes:

Prefix Keys Covers
settings.general.* 35 General options: activity retention, auto-sync interval, site title, favicon, color theme, global maintenance mode, fallback page/status, globally stripped response headers
settings.timezone.* 9 The whole Timezone block
settings.default_language.* 3 The Default language block

Catalog goes from 63 to 107 keys (34% of English). The 206 still missing stay
English by design, so nothing breaks.

Also in this commit

settings.default_language.auto: 跟随各访问者的浏览器(否则用英文)→
(否则显示英文). This is the wording change agreed in #130 — 「否则用英文」
tracked the English word order a little too closely; Chinese UI text for a fallback
reads 否则显示… / 否则为…. It is the only existing key whose value changes, and the
English text of that key is untouched.

Checklist

  • go build ./... compiles
  • go test ./internal/i18n/ ./internal/server/ -run 'Translation|Catalog|Language|Locale' passes
  • Commits are clean and the PR is focused on one concern
  • Data-only, matching docs/TRANSLATING.md
  • CHANGELOG.md / version bump — left to you, as before
  • Licensed under Apache 2.0

Notes for reviewers

Verification — run against this exact file, in a Linux container (WSL):

go test ./internal/i18n/ ./internal/server/ -run 'Translation|Catalog|Language|Locale' -count=1
go build ./...

exit=0 — including TestEveryCatalogMatchesEnglishKeysAndPlaceholders and
TestEveryTranslationKeyUsedExistsInEnglish. The CI run on this PR ("Go build and
test", ubuntu-latest) is green too.

One note if you ever test on Windows: a plain checkout there fails
internal/caddy's TestBuildProxyRouteGolden, because that test compares bytes and
core.autocrlf makes the testdata/*.json golden files CRLF on disk while the
generated JSON is LF. Nothing to do with this PR — it reproduces on an untouched
main — but it's why the local run above is documented as Linux.

Catalog facts

  • 107/107 keys valid; no key English does not have, no duplicate keys
  • Placeholders identical to English on every key ({section} keeps its position:
    保存{section}设置, with the section label substituted from the Go-defined navigation)
  • No empty values; UTF-8 without BOM; LF
  • No HTML in any value

Fragment keys, assembled — the ones the template splits around <code>/<em>:

Keys Rendered
strip_headers_help + _after CaddyUI 会在所有代理主机上从每个上游的响应中删除这些响应头。会与各主机自身的 strip_response_headers 字段拼接—两者都会生效。
timezone.help + _after 按此时间区显示时间戳(证书到期、活动日志、快照)。留空则继承容器的 TZ 环境变量。
timezone.any_iana 任意 IANA 时区名称(参见时区数据库)。
timezone.current 当前显示时区:Asia/Shanghai。
expectations.help + _after 在代理主机上定义的期望项(也就是它的期望项部分)会在每次配置同步后立即运行。请选择某项失败时的处理方式。
themes_note + _after 提供 5 种主题:默认石板蓝、碳橙、森林绿、玫瑰红 / 绯红和深靛蓝。保存在你的用户账号字段中 (users.color_theme) ,并应用于你登录的每台设备。
strip_candidates_framing + _instead 常见候选项:X-Frame-Options (当你想通过 Content-Security-Policy 控制页面嵌入 frame-ancestors 时改用), X-Powered-By、Server。
maintenance_active_1/2/3 全局维护模式已 开启 — 所有代理主机都在返回 503。同步 Caddy 以应用。

One thing worth knowing for future splits (not a bug, and nothing to change here): on
the strip_candidates and expectations lines the brackets sit at the ends of two
different fragments — ( at the end of fragment A, ) at the start of fragment B. It
works as long as each language keeps a bracket at its own end, but it does mean the
translator has to work out which bracket belongs to which clause from the fragment alone.
Worth keeping whole brackets inside a single fragment when the next line is split.

Next batches: Dashboard (96 keys) and Profile (32), plus the js.*/status.*
keys, as separate data-only PRs.

Adds the Settings › General page to the Simplified Chinese catalog: the General
options (activity retention, auto-sync, site title, favicon, color theme, global
maintenance, fallback page, globally stripped response headers), the Timezone
block, and the Default language block.

44 new keys, all of them the ones v2.63.0 added under these prefixes.
Data-only: web/i18n/zh-CN.json is the only file touched.

Also fixes the wording of settings.default_language.auto, as agreed on X4Applegate#130:
否则用英文 → 否则显示英文. 「否则用英文」followed the English word order too
closely; Chinese UI text for a fallback reads 否则显示… / 否则为….
@chongfenglaosiji
chongfenglaosiji marked this pull request as ready for review October 10, 2026 08:29
chongfenglaosiji added a commit to chongfenglaosiji/caddyui that referenced this pull request Oct 10, 2026
`settings.section.*` — The Settings navigation itself — every section name and description
`settings.expectations.*` — Post-apply checks: heading, rollback toggle and its help text
`settings.theme.*` — The colour-theme option names
`settings.*` (shared) — Settings heading, *Save … settings* button, saved/applied messages, nav aria label

Data-only: web/i18n/zh-CN.json is the only file touched.

The diff also carries the settings.default_language.auto wording fix from X4Applegate#131
(otherwise this snapshot would revert it). All the batch PRs change that same line
to the same value, so they merge cleanly in any order.
chongfenglaosiji added a commit to chongfenglaosiji/caddyui that referenced this pull request Oct 10, 2026
`dashboard.*` — The whole Dashboard page

Data-only: web/i18n/zh-CN.json is the only file touched.

The diff also carries the settings.default_language.auto wording fix from X4Applegate#131
(otherwise this snapshot would revert it). All the batch PRs change that same line
to the same value, so they merge cleanly in any order.
chongfenglaosiji added a commit to chongfenglaosiji/caddyui that referenced this pull request Oct 10, 2026
`profile.msg.*` — The server-built confirmations and errors, now looked up in the reader's language
`profile.account.*` — Account info block
`profile.totp.*` — Two-factor section
`profile.password.*` — Change-password form
`profile.*` (shared) — Page heading and intro

Data-only: web/i18n/zh-CN.json is the only file touched.

The diff also carries the settings.default_language.auto wording fix from X4Applegate#131
(otherwise this snapshot would revert it). All the batch PRs change that same line
to the same value, so they merge cleanly in any order.
chongfenglaosiji added a commit to chongfenglaosiji/caddyui that referenced this pull request Oct 10, 2026
…9 keys)

`js.health.*` — The health-dot tooltips the Dashboard and the per-host health page draw from JavaScript
`js.dashboard.*` — Dashboard script texts: update notice, upstream summary, version fallbacks
`status.*` — Shared status words: Online, Offline, Enabled, Disabled, Active, Managed, External, Read-only, Unknown

Data-only: web/i18n/zh-CN.json is the only file touched.

The diff also carries the settings.default_language.auto wording fix from X4Applegate#131
(otherwise this snapshot would revert it). All the batch PRs change that same line
to the same value, so they merge cleanly in any order.
@X4Applegate
X4Applegate merged commit c379954 into X4Applegate:main Oct 10, 2026
7 checks passed
X4Applegate added a commit that referenced this pull request Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants