Skip to content

feat: Traditional Chinese (zh-TW) + CJK font fallback + global-hotkey unregister fix#333

Open
3134q108-del wants to merge 2 commits into
PasteBar:mainfrom
3134q108-del:feat/traditional-chinese-support
Open

feat: Traditional Chinese (zh-TW) + CJK font fallback + global-hotkey unregister fix#333
3134q108-del wants to merge 2 commits into
PasteBar:mainfrom
3134q108-del:feat/traditional-chinese-support

Conversation

@3134q108-del

Copy link
Copy Markdown

What changed

Adds Traditional Chinese (zh-TW) support, fixes CJK font rendering, and fixes a global-hotkey bug.

1. Traditional Chinese (zh-TW) — feat(i18n)

  • Register 繁體中文 (zh-TW) as a selectable language (languges.ts) and ship its locale folder (src/locales/lang/zhTW).
  • Wire time-ago (locales.ts) and date-fns (date-locales) for zh-TW.

2. CJK font fallback — feat(i18n)

  • The font stack was Inter only (Latin), so CJK characters fell back per-glyph to whatever system font, causing inconsistent stroke weights.
  • Add Microsoft JhengHei / PingFang TC / Noto Sans TC to the sans stack (globals.css body + tailwind.config.js). This also improves the existing zhCN and ja locales.

3. Global hotkey not released on change — fix

  • Changing a global hotkey registered the new shortcut without unregistering the old one, so the previous combo stayed grabbed system-wide until restart (e.g. setting Ctrl+V then changing it left Ctrl+V hijacked, breaking normal paste).
  • Call unregisterAll() before (re)registering on the main window in App.tsx.

How to test

  • Pick 繁體中文 from the language menu → UI switches to Traditional Chinese, CJK text renders consistently.
  • Set a global hotkey, then change it → the previous one is released without restarting the app.

Notes

The zh-TW translation content has a companion PR to the translation repo: PasteBar/pastebar-localization#12

🤖 Generated with Claude Code

3134q108-del and others added 2 commits June 24, 2026 02:46
Register Traditional Chinese (Taiwan) as a selectable language and ship its
locale files. Also add a CJK font fallback to the global font stack so Chinese
characters render with one consistent font instead of per-glyph system
fallback, which caused inconsistent stroke weights.

- Add zhTW locale folder and register it in languges.ts
- Map zhTW for time-ago (locales.ts) and date-fns (date-locales)
- Add Microsoft JhengHei / PingFang TC / Noto Sans TC to the sans stack
  (globals.css body + tailwind.config.js)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Changing a global hotkey registered the new shortcut without releasing the old
one, so the previous combination stayed grabbed system-wide until restart (e.g.
setting Ctrl+V then changing it left Ctrl+V hijacked, breaking normal paste).
Call unregisterAll() before (re)registering on the main window so a hotkey
change takes effect cleanly without a restart.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9f2633a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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