GithubHelp home page GithubHelp logo

translation's Introduction

Translation

A word-selector translation software by PySide6

Compile and Distribution

Windows

  1. Install mingw-w64 MinGW-W64 GCC-8.1.0
  2. Add bin directory to environment variable (e.g. D:\mingw64\bin)
  3. Install dependencies
pip install -r requirements.txt
  1. Run compile and distribution
python -m nuitka --mingw64 --standalone --plugin-enable=pyside6 --include-data-dir=source_script=source_script --include-data-dir=resource=resource --remove-output --windows-disable-console  --windows-icon-from-ico=resource\translate-main.ico --show-progress translation.py

Other os

...

Usage

translation.exe

Feature

  • Not limited to the browser(in theory, it can be used in any application that can be copied with ctrl + c)
  • Plug-in translation interface, can load custom translation plugins(two translation plugins have been built in, baidu and youdao)
  • Hot reload plugin system, easy to debug

How to achieve

  1. Listen mouse events(current project listens to three events, left click and drag, double click with left button, press shitf key and click left button);
  2. Backup clipboard content;
  3. Copy selected text to clipboard;
  4. Take the clipboard text;
  5. Restore clipboard;
  6. Call API to translate text;
  7. Show results.

Note

The plugin used by the project is the compiled pyd file, which will have a faster loading speed, of course, you can also use the py file directly. I recommend you to use pyd file, similarly, it is also very simple to compile it, you only need to run the following command in the console:

python -m nuitka --mingw64 --module --output-dir source_script plugins\your_plugin.py

Screenshots

License

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.