Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here

NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Author Topic: Translator Plugin  (Read 17062 times)

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 994
    • GitHub
Translator Plugin
« on: August 26, 2012, 06:53:37 PM »
Description

A BigBrotherBot plugin which is capable o translating in-game chat messages into a specified language.

Installation

  • copy the translator.py file into b3/extplugins
  • copy the plugin_translator.ini file in b3/extplugins/conf
  • add to the plugins section of your b3.xml config file:

<plugin name="translator" config="@b3/extplugins/conf/plugin_translator.ini" />

Microsoft Translator API configuration


The Azure Application registration, provides two critical fields for API access: client id and client secret: you have to put those credentials inside the plugin configuration file.

In-game user guide

  • !translate [<source>]*[<target>] <message> translate a message
  • !translast [<target>] translate the last available sentence from the chat
  • !transauto <on|off> turn on/off the automatic translation
  • !translang display the list of available language codes

Download

Last release: https://github.com/danielepantaleone/b3-plugin-translator/archive/master.zip
« Last Edit: November 30, 2014, 11:38:20 AM by Fenix »

Offline Fragmeister

  • Full Member
  • ***
  • Posts: 78
    • Serveur FRAG on Urban terror
Re: Translator Plugin (by Mr.Click)
« Reply #1 on: September 10, 2012, 06:04:27 PM »
Thanks !
I'm going to test that !
Website of my urt server : www.frag-urt.com/

Offline Fragmeister

  • Full Member
  • ***
  • Posts: 78
    • Serveur FRAG on Urban terror
Re: Translator Plugin (by Mr.Click)
« Reply #2 on: September 11, 2012, 07:52:35 PM »
B3 stop running when he see your plugin :
b3.log

EDIT: I have b3 hosted by Host4B3!
« Last Edit: September 11, 2012, 07:54:47 PM by Fragmeister »
Website of my urt server : www.frag-urt.com/

Offline 82ndAB.Bravo17

  • Dev. Team
  • Hero Member
  • *
  • Posts: 2610
Re: Translator Plugin (by Mr.Click)
« Reply #3 on: September 11, 2012, 10:17:01 PM »
I'm guessing that
Quote
    self.debig('No other translation options available. Disabling the plugin.')

should probably be
Quote
    self.debug('No other translation options available. Disabling the plugin.')

unless you are trying to make a statement about your stature.   :D

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 994
    • GitHub
Re: Translator Plugin (by Mr.Click)
« Reply #4 on: September 11, 2012, 11:05:08 PM »
Omg....dunno where that typo come from xD
Committed the last change, should work now.

Btw Fragmeister, with your current configuration this plugin will not work. To use the Microsoft Translator API you need to fill the Microsoft Traslator info in the config file.
On the other hand, the plugin, to work with Google Translate need an UNIX like operating system.
From your log I can see:

Code: [Select]
120910 11:17:56 DEBUG   'TranslatorPlugin: Microsoft Translator API service client ID not specified. Microsoft Translator will be disabled.'
120910 11:17:56 DEBUG   'TranslatorPlugin: Microsoft Translator API service client secret not specified. Microsoft Translator will be disabled.'
120910 11:17:56 DEBUG   'TranslatorPlugin: Disabling Google Translator. You need a UNIX like operating system in order to use this functionality.'

Both translator system are going to be disabled

Offline Fragmeister

  • Full Member
  • ***
  • Posts: 78
    • Serveur FRAG on Urban terror
Re: Translator Plugin (by Mr.Click)
« Reply #5 on: September 11, 2012, 11:09:15 PM »
Yes, I notice that too! I do not know why it is listed debig instead of debug ... may be a joke of mrclick.
Website of my urt server : www.frag-urt.com/

Offline Fragmeister

  • Full Member
  • ***
  • Posts: 78
    • Serveur FRAG on Urban terror
Re: Translator Plugin (by Mr.Click)
« Reply #6 on: September 11, 2012, 11:18:52 PM »
Omg....dunno where that typo come from xD
Committed the last change, should work now.

Btw Fragmeister, with your current configuration this plugin will not work. To use the Microsoft Translator API you need to fill the Microsoft Traslator info in the config file.
On the other hand, the plugin, to work with Google Translate need an UNIX like operating system.
From your log I can see:

Code: [Select]
120910 11:17:56 DEBUG   'TranslatorPlugin: Microsoft Translator API service client ID not specified. Microsoft Translator will be disabled.'
120910 11:17:56 DEBUG   'TranslatorPlugin: Microsoft Translator API service client secret not specified. Microsoft Translator will be disabled.'
120910 11:17:56 DEBUG   'TranslatorPlugin: Disabling Google Translator. You need a UNIX like operating system in order to use this functionality.'

Both translator system are going to be disabled

Thanks, so because B3 is hosted in a Microsoft computer i've to use Microsoft API :-\
Website of my urt server : www.frag-urt.com/

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 994
    • GitHub
Re: Translator Plugin (by Mr.Click)
« Reply #7 on: September 12, 2012, 03:13:56 AM »
Yes, I notice that too! I do not know why it is listed debig instead of debug ... may be a joke of mrclick.
Was not a joke  ;D ;D I added some more debug messages before to publish the plugin and I just failed in writing "debug"....:D

Offline Foo

  • Jr. Member
  • **
  • Posts: 18
Re: Translator Plugin (by Mr.Click)
« Reply #8 on: September 25, 2012, 03:42:09 AM »
Neither download links work.
-Foo

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 994
    • GitHub
Re: Translator Plugin (by Mr.Click)
« Reply #9 on: September 25, 2012, 11:42:11 AM »
My bad, download link fixed

Offline Foo

  • Jr. Member
  • **
  • Posts: 18
Re: Translator Plugin (by Mr.Click)
« Reply #10 on: October 17, 2012, 08:04:25 PM »
So I installed this, and it works great!  I have a feature request, or I'm not sure how to do it if its possible now.

1) When !transauto on is set, if the default language is say, English, and someone types in English, don't translate as its redundant.

2) Allow people to specify their own default language, and retain it somehow, database?, so when people type, it will auto translate into that person's language.

Other than that, it works great!

Foo
-Foo

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 994
    • GitHub
Re: Translator Plugin (by Mr.Click)
« Reply #11 on: October 23, 2012, 01:34:03 AM »
The 1st one can be done but i'm not sure if it work 100%. I'ill give it a try. About the second: imho there is no need of such a feature, since u can specify the target language at runtime using !transauto on langcode
« Last Edit: October 23, 2012, 03:50:27 AM by Mr.Click »

Offline Fragmeister

  • Full Member
  • ***
  • Posts: 78
    • Serveur FRAG on Urban terror
Re: Translator Plugin (by Mr.Click)
« Reply #12 on: December 12, 2012, 05:12:14 PM »
I've tested with Microsoft API it work very good.
Just transauto doesn't work i don't know why and how it work, we just speak without command and it translate ?
I've a suggestion : Display the name of the player who used the command !trans
Website of my urt server : www.frag-urt.com/

Offline Foo

  • Jr. Member
  • **
  • Posts: 18
Re: Translator Plugin (by Mr.Click)
« Reply #13 on: December 12, 2012, 05:46:09 PM »
The 1st one can be done but i'm not sure if it work 100%. I'ill give it a try. About the second: imho there is no need of such a feature, since u can specify the target language at runtime using !transauto on langcode

So when several players from different countries are in game, each one can type !transauto, and it will translate whatever language is typed into that persons language?

ie, Player 1 - English, Player 2 - German, Player 3 - French; Player 1 types in english, and it translates German to the German player, and French to the French player presuming the German & French players executed the command !transauto?  That's not how I interpreted this command working.

transauto only translates into a single language as I understand it, no?  I'd like to see each person set their own language, it be kept in a DB field, and when someone types, it translates into that person's language.
-Foo

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 994
    • GitHub
Re: Translator Plugin (by Mr.Click)
« Reply #14 on: December 12, 2012, 06:50:34 PM »
Player1 -> !transauto on it
Player2 -> !transauto on es
Player3 -> !transauto on de

Player 4 says: Hello everybody!

Player1 will have the translation in Italian
Player2 will have the translation in Spanish
Player3 will have the translation in German

 


Rate this page +1 at Google Search

anything