Git Product home page Git Product logo

goldendict-deepl's Introduction

Node.js Plugin for Utilizing DeepL Translation API in GoldenDict/GoldenDict-ng

This Node.js plugin enables seamless integration of DeepL's translation service into GoldenDict/GoldenDict-ng, a cross-platform open-source dictionary application. GoldenDict/GoldenDict-ng can be used on Windows, macOS, and Linux systems, providing a versatile solution for translation needs.

Since the API for free users comes with monthly usage limits, I've added a feature in the plugin that automatically checks the remaining free usage after each translation request, ensuring you're always aware of your usage.

In developing this plugin, I employed various technical approaches to enhance user experience. Firstly, I used regular expressions to determine if the input content is in Chinese. If it is, the content is translated into English; otherwise, it's translated into Chinese. This makes it effortless to translate Chinese into other languages or vice versa.

Furthermore, to protect sensitive information, I stored DeepL's AUTH_KEY in a separate .env file and imported it into my code as an environment variable using the dotenv package, ensuring security and maintainability.

To use this plugin in GoldenDict/GoldenDict-ng, you need to install Node.js, git clone or download the files and unzip. Then under the project folder, npm ci to install the dependency packages.

In GoldenDict/GoldenDict-ng, press F3 or open Dictionaries settings. Add the following settings in the programs panel, the path will be different depends on where you store the script.

Screenshot 2024-02-20 154202

goldendict-deepl's People

Contributors

devjogger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.