Skip to content

Repository files navigation

Simplified / Traditional Chinese Converter (简体 / 繁体 / 拼音 / 广东话)

Automatically convert any web page between Simplified Chinese, Traditional Chinese, Pinyin, and Cantonese — a lightweight, privacy‑friendly Manifest V3 Chrome extension.

CI Node.js Manifest Code style: Prettier License: MIT Privacy Policy PRs welcome Ask DeepWiki

GitHub stars GitHub forks GitHub watchers GitHub open issues GitHub open PRs Last commit Commit activity Repo size Top language JavaScript

Chrome Web Store Users Rating

image image

Features

  • 🔁 Simplified ⇄ Traditional — convert any page between Simplified Chinese (ZH‑CN / GB2312) and Traditional Chinese (ZH‑TW / BIG5) with one click.
  • 🅿️ Pinyin — annotate Chinese characters with tone‑marked Hanyu Pinyin.
  • 🗣️ Cantonese ⇄ Mandarin — experimental dialect conversion (alpha).
  • ✅ / 🚫 Domain whitelist & blacklist — enable only selected domains, or disable specific domains, using plain substrings or regular expressions (one pattern per line). Blacklist rules take precedence.
  • ☁️ Synced settings — your preferences follow you across devices via chrome.storage.sync.
  • 🔒 Privacy‑friendly — runs entirely on your machine, collects no data, and requests only the storage permission.
  • Manifest V3 — built on the modern, service‑worker based extension platform.
  • 🌍 Localized metadata — Chrome Web Store metadata now covers 25 major language targets, including English, Chinese, Spanish, Arabic, Portuguese, Indonesian, French, Japanese, Russian, German, Korean, Hindi, Turkish, Italian, Dutch, Polish, Vietnamese, Persian, Thai, Bengali, Marathi, Telugu, Tamil and Filipino.

Install

From the Chrome Web Store (recommended)

Install the published extension here:

👉 Chrome Web Store

From source (unpacked)

  1. Clone this repository (see Development).
  2. Open chrome://extensions in Chrome.
  3. Enable Developer mode (top‑right).
  4. Click Load unpacked and select the gb2312-big5/ folder.

Usage

  1. Click the extension icon in the toolbar.
  2. Under Setting, choose a target:
    • 关闭 Turn Off
    • 中文简体 Simplified Chinese
    • 中文繁體 Traditional Chinese
    • 拼音 Pinyin
  3. (Optional) Choose a Dialect (Mandarin / Cantonese — alpha).
  4. (Optional) Add whitelist domain patterns to enable the extension only on selected sites.
  5. (Optional) Add blacklist domain patterns to skip specific sites. Blacklist rules override whitelist rules.
  6. Click Apply & Reload Page for the changes to take effect.

Development

Prerequisites

Setup

git clone https://github.com/DoctorLai/Simplified-and-Traditional-Chinese.git
cd Simplified-and-Traditional-Chinese
npm install

Scripts

Command Description
npm run lint Lint the source with ESLint.
npm run lint:fix Lint and auto‑fix where possible.
npm run format Format the codebase with Prettier.
npm run format:check Verify formatting without writing changes.
npm run fix Auto‑fix lint issues and reformat in one step.
npm test Run the Jest unit tests.
npm run test:watch Run the Jest unit tests in watch mode.
npm run coverage Run the tests and enforce the coverage threshold.
npm run check Run lint + format check + coverage + build (the CI gate).
npm run build Package the extension into dist/*.zip for the Chrome Web Store.
npm run clean Remove the dist/ and coverage/ build artifacts.

Build a publishable package

npm run build
# -> dist/simplified-and-traditional-chinese-v<version>.zip

The generated .zip has manifest.json at its root and can be uploaded directly to the Chrome Web Store Developer Dashboard.

Testing

Unit tests run on Jest and cover the pure conversion helpers, DOM traversal, the localized metadata, and the content-script bootstrap:

npm test          # run the suite
npm run coverage  # run with coverage and enforce the thresholds

Coverage is collected from gb2312-big5/js/convert.js and gated in CI. Please add or update tests when you change conversion behaviour.

Project structure

gb2312-big5/            # The unpacked extension (this is what gets zipped & published)
  manifest.json         # Manifest V3
  main.html             # Popup UI
  js/
    background.js       # Service worker
    convert.js          # Core conversion logic + content-script bootstrap
    main.js             # Popup logic
    dialect.js          # Cantonese <-> Mandarin tables
    pinyin.js           # Pinyin lookup table (generated data)
  _locales/             # i18n messages (25 locales)
scripts/build.js        # Packages the extension into dist/*.zip
tests/                  # Jest unit tests (convert, DOM, i18n, content-script)

Contributing

Contributions are welcome! Please read CONTRIBUTING.md, follow our Code of Conduct, and make sure npm run check passes before opening a pull request. Notable changes are recorded in the Changelog.

Privacy

This extension runs locally in your browser and does not collect, transmit, sell, or share personal data. See the Privacy Policy for details.

Security

Found a vulnerability? Please report it privately — see our Security Policy for how to disclose issues responsibly.

Support

Enjoy what I am doing? Support me via:

More free online tools: https://helloacm.com/tools/

Related posts

License

Released under the MIT License.

About

Between Simplified Chinese (ZH-CN or GB2312) and Traditional Chinese (ZH-TW or BIG5)

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

22 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages