Skip to content

A pop-up dictionary extension for Chinese with Reader Function

License

Notifications You must be signed in to change notification settings

aligator527/CDIEXT-firefox

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

CDIEXT

A pop-up dictionary extension for Chinese with Reader Function

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Usage
  3. Roadmap
  4. Contributing
  5. License
  6. Contact
  7. Acknowledgments

About The Project

Game Screen Shot

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.

(back to top)

Usage

Game Screen Shot WikiPedia Screen Shot Youtube Screen Shot

(back to top)

Build

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

Roadmap

  • 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).

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

File Structure

    .
    ├──📕 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

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Ivan Dolgov - LinkedIn - aligator527official@gmail.com

Project Link: https://github.com/aligator527/CDIEXT-firefox

(back to top)

Acknowledgments

Thank you for N1, Nazeka-sama.

(back to top)