Skip to content

feat(wiki): 新增韩语 (ko) 作为站点支持语言#31

Open
mkpoli wants to merge 12 commits into
project-trans:mainfrom
mkpoli:feat/ko-language-support
Open

feat(wiki): 新增韩语 (ko) 作为站点支持语言#31
mkpoli wants to merge 12 commits into
project-trans:mainfrom
mkpoli:feat/ko-language-support

Conversation

@mkpoli
Copy link
Copy Markdown

@mkpoli mkpoli commented May 11, 2026

概要

ko 注册为本 wiki 的支持语言之一,与既有的 zh-cn · zh-hant · ja · en · es 平行。本 PR 只动 app 侧 i18n / 配置;韩语内容本身由 source 内容侧 PR(project-trans/MtF-wiki#1741)提供。

变更内容

lib/site-config.ts

  • languages 数组新增 { code: 'ko', subfolders: ['docs', 'about'], noMarkdown: getGlobalNoMarkdown() },与 ja · en · es 一致。

lib/i18n/translations/

  • language-names.json — 新增 "ko": "한국어"
  • translations.json — 已有全部 35 个键各新增 ko 翻译
  • server-translations.json — 已有全部 30 个键各新增 ko 翻译;同时新增 banner-button-link-disclaimer.ko = "/ko/about/disclaimer"
  • not-found-translations.json — 已有 4 个键各新增 ko 翻译

components/HomeRedirect.tsx

  • 浏览器语言映射新增 ko*/ko 分支,与既有 zh* 处理对称。
  • 顺便补全一处缺少 reason 的 biome-ignore 注释(pre-commit hook 现在要求 reason)。

components/SearchableTerminologyTable.tsx

  • TermEntry 接口新增 ko: string'aliases-ko': string 字段。
  • LANG_ORDER / LANG_LABELS 新增 ko;位于 jaen 之间。
  • CATEGORY_LABELS 全部 10 个分类各新增 ko 字符串(정체성 / 호르몬 치료 / 수술 / 음성 / 제모 / 의료 체계 / 법률·신분증 / 사회 / 검사 수치 / 기타)。
  • 过滤逻辑新增 e.ko / e['aliases-ko'];Wikidata 语言映射表新增 ko: 'ko'

注:SearchableTerminologyTable.tsx#29 引入,本 PR 在其上叠加 ko 支持。

依赖关系 / 关联 PR

Important

本 PR 仅修改 app 侧 i18n / 组件,包含 source/ 子模块指针更新。/ko/* 路由需在以下两个内容 PR 合并后再以一次小 PR 推进子模块指针。

建议合并顺序:MtF-wiki#1741 先合并 → 本 PR rebase 到 main → 合并 → 一次小 PR 推 source/ 指针

必要依赖

配套(独立 PR,不阻塞)

  • project-trans/2345.LGBT#47 — 在 2345.LGBT 新增 content.ko/ locale(含韩国本土组织与资源条目)。按设计,韩国相关导航条目集中在 content.ko/,不混入 en / zh-cn locale。

Test plan

  • pnpm dev 启动后 /ko/ko/docs/ko/docs/srs/ko/docs/srs/korea/overview/ko/docs/hrt/korea/overview/ko/docs/transition-korea/ko/about/ko/about/disclaimer 均返回 HTTP 200
  • LanguageSwitcher 在其他 locale 页面下拉中显示 한국어
  • 在浏览器 Accept-Language: ko-KR 下访问首页 / 自动跳转 /ko
  • 术语表组件在 /ko/docs/terminology 下能正确把 ko 列与其他语言并列
  • 既有 5 种语言路由无回归

🤖 Generated with Claude Code

mkpoli and others added 12 commits May 9, 2026 22:29
- SearchableTerminologyTable: client component with real-time search,
  per-language column priority, expand-on-click for aliases/avoid/notes,
  and a ready Wikidata link field for future integration
- remarkTerminologyGlossary: remark plugin that loads data/terminology.tsv
  at build time and injects it into the {{< terminology-glossary >}} shortcode
- Wires both into the MDX pipeline in page.tsx
- Adds 9 i18n keys (search, count, no-results, source, aliases, avoid,
  disputed, notes) for all five languages

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds client-side searchable terminology table with category grouping,
column visibility toggle, abbreviation badges, alias chips, highlight,
and expand rows for Wikidata/notes. Adds terminology-* i18n translations.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace last?.category with last && last.category to prevent
undefined === undefined matching when groups array is empty.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Show aliases per language column (aliases-{lang} fields)
- Search across all alias columns
- Remove current-lang highlight from header (was too bright)
- Link Wikidata QIDs to Wikipedia via Special:GoToLinkedPage/{lang}wiki
  so clicking opens the Wikipedia article in the user's language

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Expanded row now shows:
- The QID (e.g. Q1052281) linking to wikidata.org
- A "Wikipedia ↗" link using Special:GoToLinkedPage redirecting to
  the Wikipedia article in the user's browsing language

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When the current language is not English, show two Wikipedia links:
- "Wikipedia ↗" → article in the user's language
- "Wikipedia (EN) ↗" → English Wikipedia (richest content)
When browsing in English, show a single "Wikipedia ↗" link.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Links in the Wikidata section used full link-primary (orange) which was
too harsh in light mode. Now uses text-primary/65 with hover:text-primary
for a softer default that brightens on hover.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… color

- Expand row bg: base-100 → base-200 (visually separates expanded content)
- Detail dl font: text-sm → text-xs (matches table-xs cell density)
- Links: drop text-primary/65 orange; use text-base-content/70 with
  underline (matches prose link style used elsewhere on wiki pages)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace bare <> fragments inside .map() with <Fragment key={...}> so
React can uniquely identify each group and each entry row pair.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
将 `ko` 注册为本 wiki 的支持语言之一,与既有的 zh-cn · zh-hant · ja · en · es 平行。
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.

1 participant