To create new wiki account, please join us on #znc at Libera.Chat and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Translate: Difference between revisions

From ZNC
Jump to navigation Jump to search
 
Line 58: Line 58:


== Note ==
== Note ==
Contact '''DarthGandalf''' on irc://irc.freenode.net/#znc, or '''DGandalf''' on irc://irc.efnet.org/#znc for bug reports and suggestions.
Contact '''DarthGandalf''' on irc://irc.freenode.net/#znc for bug reports and suggestions.

Latest revision as of 21:04, 21 May 2017

This module acts as a translator between people, neither of whom know each other's language. Each person can just write in his/her preferred language, and this module will take care of translating both sides and seamlessly displaying the translated text to both parties. Module works for:

  • private messages between you and another person;
  • channels, between you and all other people on that channel;
  • channels, between you and one particular other person on that channel.

The module uses Google Translate via its API.

Google chose to close its Translate API at 2011-12-01 and made it a paid service, so the module is broken currently. I'll need to find another way to translate stuff. If someone wishes to help, welcome.

Installing

The code for this module can be found here (https://raw.github.com/DarthGandalf/znc/0d9392149528b7f95d941c85c5df54bc56f92a57/modules/translate.cpp raw). Follow the Compiling modules page to compile it.

Usage

Arguments

This user module takes no arguments.

Read loading modules to learn more about loading modules.

Configuration

Configuration is done via *translate

Commands

+---------+------------------------------+------------------------------------------------------+
| Command | Arguments                    | Description                                          |
+---------+------------------------------+------------------------------------------------------+
| my      | <xy>                         | Set your default language                            |
| set     | <channel> <xy> [<my>]        | Set language of channel                              |
| set     | <nick> <xy> [<my>]           | Set language of private messages for nick            |
| set     | <channel>/<nick> <xy> [<my>] | Set language for nick on channel                     |
| unset   | <channel or nick>            | Don't translate target anymore                       |
| clear   |                              | Clear all targets                                    |
| list    |                              | Show list of configured targets with their languages |
| help    |                              | Show this text                                       |
+---------+------------------------------+------------------------------------------------------+

You can use set #channel/nick to translate messages only to/from that nick on this channel. Messages to them have one of these forms (assuming, we speak to Nicky):

  • Nicky hello
  • Nicky, hello
  • Nicky: hello

set command has 1 optional parameter in the end - your language for translating conversations. If it's empty, using default, which is specified with my command.

Example:

set #znc/Nicky de bg

if you want to speak with Nicky (who is German) on #znc using Bulgarian.

Version history

2010-06-25

Fixed compilation errors for ZNC 0.090.

2010-04-22

Add support for set #channel/nick.

2009-12-01

First version.

Note

Contact DarthGandalf on irc://irc.freenode.net/#znc for bug reports and suggestions.