Table of Contents
I used Nazeka in Firefox with Textractor to learn Japanese through visual novels. However, when I tried to apply the same method to learn Chinese, I couldn't find an extension that allows copying text from the clipboard into a separate window for translation. Therefore, I decided to create my own extension to facilitate learning Chinese through visual novels. This extension also works with web pages and even INPUT elements, which other extensions don't support. It seems like I'm the only one who cares about this functionality!
So, basically, there are:
- Pop-up Dictionary for Web Pages: Instantly translate words on web pages using a pop-up dictionary.
- Separate Window for Clipboard Text: Copy Chinese text from the clipboard (using Textractor for visual novels) and view translations in a separate window.
- Word Translation Check: Easily check translations of words in the separate window.
- Customizable Styles: Adjust the extension's appearance through the Options window.
First of all, download the Cedict file from https://www.mdbg.net/chinese/dictionary?page=cc-cedict (look for cedict_1_0_ts_utf-8_mdbg.zip
).
Put cedict_ts.u8
to the folder with CedictToAdvancedJson.py
and run the code:
python CedictToAdvancedJson.py
Then you get files cedict_1.json
, cedict_2.json
, ..., cedict_10.json
.
Put them inside data
folder.
Then run about:debugging
in Firefox, add extension by uploading manifest.json
file
- Add options for styles of pop-up dictionary
- Add options for styles of reader
- Add sticky mode
- Add hotkey for sticky mode
- Add function of playing audio
- Add function of adding word to Anki
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
.
├──📕 assets // This directory stores static assets such as CSS, JavaScript, and image files.
│ ├──📕 js // Scripts for the popup and the content scripts.
│ │ └──📄 content.js
│ └──📕 img // Images used by the extension, such as icons
│ ├──📄 icon.png
| └──📄 icon_disabled.png
├──📕 data // This directory contain CC-CEDICT file
├──📕 options // This directory contain options Page and configure file
| ├──📄 options.html
| ├──📄 options.js
| └──📄 configure.json
├──📕 reader // This directory contain the HTML&JS file that represents the reader window of the extension
│ ├──📄 reader.html
| └──📄 reader.js
├──📄 manifest.json // This is the manifest file for the extension. It specifies basic metadata for the extension, like its name and version, permissions it requires, and scripts it needs to run.
└──📄 background.js // This is the background script of the extension. It listens for events and controls the behavior of the extension.
├──📄CedictToAdvancedJson.py // Generate cedict_advanced.json (you can see format of file lower in README, also file is located at CDIEXT-firefox/data)
├──📄CedictToJson.py // Generate cedict.json (simplified version of dictionary, not used in this extension)
├──📄LICENCE
├──📄README.MD
Distributed under the MIT License. See LICENSE
for more information.
Ivan Dolgov - LinkedIn - aligator527official@gmail.com
Project Link: https://github.com/aligator527/CDIEXT-firefox
Thank you for N1, Nazeka-sama.