Coder Social home page Coder Social logo

hisacro / hexchat-google-translator-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from epicjhon/hexchat-google-translator-plugin

1.0 2.0 0.0 31 KB

python translation script for hexchat

License: MIT License

Python 100.00%
irc hexchat translation

hexchat-google-translator-plugin's Introduction

Hexchat-Google-Translator-Plugin

Download google_translator.py and trnaslate.py

Modify this lines on google_translator.py

default_from = 'en'
default_to = 'es'

Place google_translator.py and trnaslate.py in /home/user/.config/hexchat/addons to auto-load at hexchat startup.

mkdir if addons does not exist

language codes can be found here

Usage

note: Right clicking on channel or user will promt the menu. [+] [-] autotranslate option will add them to watchlist. Default from, to languages are used.

Adding channels to watch list for auto translations. If target language is not specified, then the DEFAULT_LANG set will be used. If source language is not specified, then language detection will be used.

/ADDTRC <channel> <target_language> <source_language>

# removing it from watchlist
/RMTRC <channel>
# For adding users
/ADDTR <user_nick> <target_language> <source_language>

# For removing users
/RMTR <user_nick>

Tracking watchlist

# list of channels
# format
# <network> <channel_name> => (<target_language>,<source_language>)
/LSCHANNELS

# list of users
/LSUSERS

For sending messages in target language to a users or in channel (already in watchlist) start the message with "!!"

# eg channel #testing is added to watchlist
/ADDTRC #testing de en

# since the target language is German
!!no
# will promt the message
# > no
# then sends the translated message to the channel 
nein

# user_mention exception when input starts with !!@
!!@chair123, this should work
# output to server, chair123 is not translated
chair123, das sollte funktionieren

For translating the message when user or channel not in watchlist, star the message with "@@" this will use the default source and target language.

# default source is 'en' and target is 'es' (these lines can be modified in google_translator.py) 
@@yes
# promt output (only visible on user side)
Sí

Auto detecting 'from' language for users and channels under watchlist, edit translation variable under function worker_hook_print_message

# translation varibale
translation = translate(message,'',to)

Additional Commands

# equivalent to starting the message with "@@"
/TR <message>

Translates message into the language according to form "to-from". This auto detects the source language

/TRA <source language> <target language> <message>

Translates message into the language specified. This auto detects the source language.'

/STR <message>

Sends a message translated according to form "to-from", where "from" isthe default language of origin and "to" is the default language destination

Reloading Script

Unload the google-translator.py script then reload the python module.

Directly reloading google-tranlator.py script invokes multiple instances of translate module.

hexchat-google-translator-plugin's People

Contributors

epicjhon avatar hisacro avatar

Stargazers

 avatar

Watchers

 avatar  avatar

hexchat-google-translator-plugin's Issues

New ideas

  1. user translation could override channel translation, like someone speaking russian, in a korean channel. And all I want to translate to english.

  2. when saying !!@Nickname message - the @Nickname part should be kept as is.

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.