https://github.com/tnychn/opencc-extension
🀄️ A browser extension to convert webpages between different Chinese variants. Powered by OpenCC.
https://github.com/tnychn/opencc-extension
browser chinese chrome extension firefox javascript opencc simplified-chinese traditional-chinese
Last synced: 3 months ago
JSON representation
🀄️ A browser extension to convert webpages between different Chinese variants. Powered by OpenCC.
- Host: GitHub
- URL: https://github.com/tnychn/opencc-extension
- Owner: tnychn
- License: mit
- Created: 2021-07-01T18:46:02.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-12-04T07:11:22.000Z (over 1 year ago)
- Last Synced: 2024-12-04T08:20:56.244Z (over 1 year ago)
- Topics: browser, chinese, chrome, extension, firefox, javascript, opencc, simplified-chinese, traditional-chinese
- Language: JavaScript
- Homepage: https://addons.mozilla.org/firefox/addon/opencc
- Size: 12.5 MB
- Stars: 32
- Watchers: 4
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
opencc-extension

A browser extension that converts text in the current active tab between different Chinese variants.
This extension is powered by [opencc-js](https://github.com/nk2028/opencc-js),
which is a JavaScript API wrapper around the great [OpenCC](https://github.com/BYVoid/OpenCC) project.
Most of the variants supported by OpenCC are supported:
- `cn`: Simplified Chinese (Mainland China)
- `hk`: Traditional Chinese (Hong Kong)
- `tw`: Traditional Chinese (Taiwan)
- `twp`: Traditional Chinese (Taiwan) with native phrases
- ~~`t`: Traditional Chinese (OpenCC standard)~~
- ~~`jp`: Japanese Shinjitai~~
> [!NOTE]
> Only Chrome and Firefox are tested.
> Other browsers may also work but are not guaranteed to.
## Features
- Minimalist user interface.
- Fast performance (using [`TreeWalker`](https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker)).
- Converts whole text on a webpage with one click.
- Can also convert dynamically rendered text in auto mode
(using [`MutationObserver`](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver)).
- Converts selected text on a webpage in right click context menu.
- Converts any text provided in the text box in real time.
- Other features of OpenCC.
- 嚴格區分「一簡對多繁」和「一簡對多異」。
- 完全兼容異體字,可以實現動態替換。
- 嚴格審校一簡對多繁詞條,原則爲「能分則不合」。
- 支持中國大陸、臺灣、香港異體字和地區習慣用詞轉換,如「裏」「裡」、「鼠標」「滑鼠」。
See [usage](#usage) for more ways to convert text.
## Usage
Specify the language settings in the extension popup.
Origin → Target
- **Origin**: the original Chinese text variant in the webpage
- **Target**: the desired Chinese text variant to be converted into
Left: Convert Text Selection on Webpage
Right: Convert Any Text in Text Box
Left: One Click
Right: Auto Mode
> [!NOTE]
> For performance reason, auto mode will not convert text on webpages which
> explicitly specify their `lang` attributes to be languages other than `zh` in their HTML documents.
When auto mode is enabled, a grey badge with the letter `A` appears on the corner of the extension icon.
All text in the webpage of the current active tab is converted whenever it loads or is updated.
## Credits
- https://github.com/BYVoid/OpenCC
- https://github.com/nk2028/opencc-js
---
~ crafted with ♥︎ by tnychn ~
MIT © 2024 Tony Chan