-
Notifications
You must be signed in to change notification settings - Fork 0
feat: ip-governance-ai 英文版(整頁翻譯) - #286
Merged
Merged
Conversation
這頁是 one-more-step 底下最後一個沒有英文版的,而且和先前那 12 篇不同——
它是真的一個英文字都沒有,約 4,600 個中文字全部需要翻譯。
遷移方式沿用 symbolic-reminder.astro:檔案移到 [...lang]/ 下,用
t(zh, en) 依網址決定語言,兩個網址各自渲染單一語言。
**HTML 結構一字未動**,只把文字換成 t()。這頁自帶 240 行 CSS 變數與斷點,
把內容抽成資料結構再重排版的風險遠大於收益;保留結構也讓 diff 逐行看得出
中英對照,好審。script 與 style 區塊(第 647 行之後)原樣保留。
翻譯處理:
- 法律與 IP 術語走通用英文(trade secret、work-for-hire assignment、
freedom to operate、background/foreground IP...),縮寫原樣保留
(TIPS、DTSA、PCT、WIPO、CHIPS Act、EU AI Act)
- ⚠ 人名、刊名與公司中文名保留原文並標 lang="zh-TW":《全國律師》與
「安卓樂資本」查不到官方英文名,音譯過去等於自己發明一個譯名——
引用來源寫錯比留著原文糟。這與 hello-world 英文版保留人名的處理一致
- 測驗題的 onclick 屬性沒有動:頁內 script 靠 getAttribute('onclick')
比對 ',true)' 找出正解,改了會讓答錯時不再標示正確選項
驗證(build 出 dist 再掃,不是看原始碼推論):
- 英文頁 <main> 內可見中文 7 處,全部是上述刻意保留的專有名詞,
且都包在 <span lang="zh-TW"> 裡(中文頁對照為 358 處)
- <html lang="en">、canonical 指自己、hreflang 三向互指、
JSON-LD inLanguage 為 en、headline 換成英文
- 返回連結指向 /en/projects/one-more-step/,樞紐頁中英各自連到同語言的版本
- verify-i18n-hreflang 65 → 66 對且互指成立,verify-i18n-meta 66 頁無中文洩漏
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Deploying personal-website with Cloudflare Pages Cloudflare Pages
Latest commit:
6ac50a5
Status: ✅ Deploy successful!
Preview URL:
https://533c5c49.personal-website-1m7.pages.dev
Branch Preview URL:
https://feat-ip-governance-ai-en.personal-website-1m7.pages.dev
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
做了什麼
/projects/one-more-step/ip-governance-ai/是 one-more-step 底下最後一個沒有英文版的頁。和先前那 12 篇不同 —— 它一個英文字都沒有,約 4,600 個中文字全部需要翻譯。新增
/en/projects/one-more-step/ip-governance-ai/。怎麼做的
遷移方式沿用
symbolic-reminder.astro:檔案移到[...lang]/下,用t(zh, en)依網址決定語言,兩個網址各自渲染單一語言。HTML 結構一字未動,只把文字換成
t()。這頁自帶 240 行 CSS 變數與斷點,把內容抽成資料結構再重排版的風險遠大於收益;保留結構也讓 diff 逐行看得出中英對照。script與style區塊(原第 647 行之後)原樣保留。翻譯上的三個決定
lang="zh-TW"—— 《全國律師》與「安卓樂資本」查不到官方英文名,音譯過去等於自己發明一個譯名,引用來源寫錯比留著原文糟。這與hello-world英文版保留人名的處理一致。onclick屬性沒有動 —— 頁內 script 靠getAttribute('onclick')比對,true)找出正解,改了會讓答錯時不再標示正確選項。驗證
build 出
dist再掃,不是看原始碼推論:<main>可見中文<span lang="zh-TW">裡(中文頁對照 358 處)<html>lang="en"inLanguage: en、headline 換成英文/en/projects/one-more-step/沒有動
data/page-manifest.json—— 那由 workflow 自己維護。🤖 Generated with Claude Code