GithubHelp home page GithubHelp logo

kwbmm / wr-translator Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 2.0 53 KB

A script to quickly translate words from/to english to your native language and vice versa inside Rofi launcher.

License: GNU General Public License v3.0

Python 100.00%
wordreference translation translate rofi translator

wr-translator's Introduction

WR-translator

A script to quickly translate words from/to english to your native language and vice versa inside Rofi launcher.

Disclaimer

I am by no means a Python guru. The code can be improved for sure in some ways.

This is a home-made project I did to have quick access to translations from english to italian (my own language), and was further extended to support the main other languages available on Wordreference.

Feel free to fork, modify and suggest improvements.

No guarantees on keeping this project up to date are given as this is done during my free time.

Requirements

  • Rofi
  • Python 3
  • BeautifulSoup 4

Usage

The script takes as input 3 parameters:

  • Language Interface: it, en, fr, es, de
  • Source Language: it, en, fr, es, de
  • Target Language: en (if it/fr/es/de is chosen) or it/fr/es/de (if en is chosen)

You can translate quickly, using Rofi, any word in the given language to the other target language.

Examples

Translate from spanish to english, spanish interface language:

python3 wordreference.py es es en

Example 1

And after you press Return:

Example 2

Translate from italian to spanish, italian interface language:

python3 wordreference.py it it es

This prints the help message because non-english to non-english language translation is not supported:

usage: wordreference.py [-h] {en,it,es,fr,de} {en,it,es,fr,de} {en,it,es,fr,de}

This is used to get a quick translation from italian, french or spanish to
english OR viceversa. NOTE: translation from non-english to non-english or
from same-language to same-language is forbidden

positional arguments:
  {en,it,es,fr,de}  Interface language
  {en,it,es,fr,de}  Source translation language
  {en,it,es,fr,de}  Target translation language

optional arguments:
  -h, --help     show this help message and exit

wr-translator's People

Contributors

kwbmm avatar skoschnicke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.