Skip to content

Add Chinese (zh) locale #47

Description

@Jiseoup

Context

showmycode currently ships English (en) and Korean (ko).
This issue adds Chinese (zh).

Great first issue — it follows the existing i18n pattern and touches only 5 well-defined spots.
No architecture knowledge needed.

What to do

  1. Create locales/zh.json by translating every key in locales/en.json (nav, repo, code, commits, pulls, error, unauthorized). Keep the same JSON structure.
  2. lib/i18n.ts → add "zh" to the locales array.
  3. locales/index.ts → add export { default as zh } from "./zh.json";
  4. lib/i18n.server.ts → add to the load map:
    zh: () => import("@/locales/zh.json").then((m) => m.default),
  5. components/LangSwitcher.tsx → add zh: "ZH" to the labels record.

Locale detection (Accept-Language) and routing are automatic — no changes needed in proxy.ts or the unauthorized page.

Note on Chinese variants

Use Simplified Chinese for zh in this issue.
Locale detection strips the region (zh-CN/zh-TWzh), so a single zh covers both for routing.
Traditional Chinese (zh-TW) as a separate locale can be a follow-up issue — out of scope here.

⚠️ Do not translate

GitHub status badges (Private/Public, Merged/Open/Closed, file statuses Added/Removed/Modified/Renamed) stay in English in every locale.

Acceptance criteria

  • /zh routes render correctly across home, code, commits, and PR pages
  • The ZH option appears in the language switcher and switches correctly (query params preserved)
  • npm run format:check, lint, typecheck, and build all pass
  • Verified in dark mode and on mobile (≥320px)

Comment below to claim this — we'll assign it to avoid duplicate work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueA small, well-scoped issue ideal for first-time contributorsi18nInternationalization and translations

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions