thankyou
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: Translators plugin  (Read 15569 times)

Offline daiosama

  • Jr. Member
  • **
  • Posts: 22
    • Elite Brotherhood Clan
Re: Translators plugin
« Reply #15 on: September 24, 2010, 05:37:58 PM »
Ok running with this idea a little.  I think it would be easy enough to allow the user to register a default language for him or herself. and then B3 could custom translate for that person.  I'd probably restrict this to regulars only.  don't want to over burden the bot.

Also, how would I change the code so that the output of !trans  go to everyone and not just me in a pm.

And one last thing.  This is a totally wicked plug in.  the guys on the server have ranted and raved about it.


I think it should be possible and not too hard using the functions provided by the CountryFilter plugin. It would be a good idea indeed, people would get the auto translation directly in their language instead of the default English one.

Offline UniversalRose

  • Jr. Member
  • **
  • Posts: 44
Re: Translators plugin
« Reply #16 on: October 17, 2010, 03:25:41 PM »
I think it should be possible and not too hard using the functions provided by the CountryFilter plugin. It would be a good idea indeed, people would get the auto translation directly in their language instead of the default English one.

Would it be an idea to extend this a bit more and let people decide whether they want the translation or not?
Using the CountryFilter plugin a !command like: !translate without argument would give them a translation in their own language, !translate Uk would give them the translation in English, !translate sw in swedish, ect. !translate off would turn it off.


Another question i have is: Would it be possible to give the autotranslate more than one source language?

On our server we play with alot of dutch people who all speak english very well. The plugin translates evrything, which sometimes gets annoying. But we also have a few people from Sweden, Finland and France who dont speak english. Would it be possible to make the autotranslator work with only those 3 languages translated to english?


Offline Merph

  • Beta Testers
  • Jr. Member
  • *
  • Posts: 25
Re: Translators plugin
« Reply #17 on: April 03, 2011, 03:53:33 PM »
- special characters like accented letters or cyrillic are not displayed.
:( bad
it would be nice if worked with Cyrillic

Offline beepbeep

  • Full Member
  • ***
  • Posts: 71
Re: Translators plugin
« Reply #18 on: June 13, 2011, 05:04:56 PM »
trans en|pt hello



cant translate to portuguese. is this the right code? is there an official code list?

Offline MordyT

  • Moderator
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: Translators plugin
« Reply #19 on: August 01, 2011, 12:55:59 AM »
I am a bit confused. Say I want to translate to spanish... !trans en (?) es this is a test.
What is the letter I put between the en and the es?
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline MordyT

  • Moderator
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: Translators plugin
« Reply #20 on: November 13, 2011, 05:57:27 AM »
FWIW, not sure if this plugin will work for much longer.
Google is shutting down - er making paid - its API for translate.
See: http://googlecode.blogspot.com/2011/05/spring-cleaning-for-some-of-our-apis.html

Would be awesome if someone updated it to either A: Use the paid API (options in the config file) or B: Use MS translate API (https://datamarket.azure.com/dataset/1899a118-d202-492c-aa16-ba21c33c06cb) once again options in the config file.

Just a heads up.
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline pa3ck

  • Full Member
  • ***
  • Posts: 50
Re: Translators plugin
« Reply #21 on: December 30, 2011, 04:09:46 AM »
Hi!

So this plugin is not usable anymore? Or can I still use for my CoD4 server?
NEVERDiE GAMiNG pa3ck

Clan and CoD4 servers owner

Offline MordyT

  • Moderator
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: Translators plugin
« Reply #22 on: December 30, 2011, 02:46:25 PM »
Hi!

So this plugin is not usable anymore? Or can I still use for my CoD4 server?
Well, I don't think it still works anymore, I just tested it today and here is what happened....

Code: [Select]
111230 07:42:42	CONSOLE	'20037:20 say;GUID;0;Mordy;\x15!trans en|es hi'
111230 07:42:42 VERBOSE 'Queueing event Say !trans en|es hi'
111230 07:42:42 VERBOSE 'Parsing Event: Say: AdminPlugin'
111230 07:42:42 DEBUG 'AdminPlugin: OnSay handle 5:"!trans en|es hi"'
111230 07:42:42 DEBUG 'AdminPlugin: Handle command !trans en|es hi'
111230 07:42:42 VERBOS2 'Say event handled by AdminPlugin in 13.930 ms'
111230 07:42:42 VERBOSE 'Parsing Event: Say: ChatloggerPlugin'
111230 07:42:42 DEBUG 'ChatloggerPlugin: ALL, 2, Mordy, !trans en|es hi'
111230 07:42:42 DEBUG 'ChatloggerPlugin: writing to file'
111230 07:42:42 DEBUG 'ChatloggerPlugin: writing to database'
111230 07:42:42 DEBUG 'ChatloggerPlugin: rowcount: 1, id:84508'
111230 07:42:42 VERBOS2 'Say event handled by ChatloggerPlugin in 14.246 ms'
111230 07:42:42 VERBOSE 'Parsing Event: Say: TranslatorsPlugin'
111230 07:42:42 VERBOS2 'Say event handled by TranslatorsPlugin in 14.745 ms'
111230 07:42:42 VERBOSE 'Parsing Event: Say: TelnetPlugin'
111230 07:42:42 VERBOS2 'Say event handled by TelnetPlugin in 13.573 ms'
111230 07:42:42 DEBUG 'TranslatorsPlugin: Unable to translate the sentence : en|es hi'
111230 07:42:42 VERBOSE "RCON sending (85.234.137.75:2304) 'tell 0 [^4R^1vO^4B^1ot^7]: ^3[pm]^7 Unable to translate'"

But maybe a issue on my end. Maybe try it and report back?
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 981
    • GitHub
Re: Translators plugin
« Reply #23 on: June 02, 2012, 04:17:48 AM »
Hello there. Is quite a long time that people do not come up with something related to this plugin.
As everyone (or almost) know Google have shut down the old Translator API and the new one are  a paid service. Here comes the fun ^^

I actually got a working solution which doesn't use a paid service.
I'm going to rebuild the Translator plugin from scratches, by looking at SvaRoX code (mostly to keep the commands syntax) and maybe adding something more.
If anyone is interested in this plugin please reply below and I will share it with the community.

Greetz!

Offline MordyT

  • Moderator
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: Translators plugin
« Reply #24 on: June 04, 2012, 06:14:34 PM »
Very much interested. We have been missing this plugin very very much...
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 981
    • GitHub
Re: Translators plugin
« Reply #25 on: June 04, 2012, 07:20:37 PM »
Ok, I need some more days of testing but it should be done ^^
Actually the plugin I made has some new features but also some limitations:

1) The translation is provided by using 2 different API services (Google + Microsoft):
Google only works if the b3 is running on a UNIX based system (more info when I release the code).
Microsoft is platform indipendent since I completely wrote the python module which allow the communication with the Microsoft Translator API service (Microsoft release just the C# and PHP module). To use the Microsoft API, it's needed an account on the Azure Marketplace (the basic account is free of charge and allow a max translation of 2.000.000 words per month)

2) Is possible to choose, via config file, which translation method you want to use. If the 1st one fail, the translation is provided using the 2nd API service (if available). I used 2 different translation systems because the Google solution is kinda tricky, and because of the Micorosft limitation using a free account.

3) I rewrote the entire plugin changing some commands syntax. Basically what i have now is this:


 - !trans [<source>*<target>] <sentence> : Translate the correct sentence.
 - !translast [<target>]: Translate the last sentence typed in chat
 - !transauto <on|off> <language> : Switch on and off the automatic translation. The translation is  returned just to the client who issued the !transauto command (so he can specify the favourite language for the translation)
 - !translang : show the available language codes
 - !transname <on|off> : switch the translator name on and off. This plugin is also able to show the name of the translator who issued the translation before the translated sentence. At first i developed this thing for debug purpose only but I think will left it in
 - !transchange : change the favourite translator at runtime

The plugin will be compatible with all the games supported by b3, but actually it is optimized of UrT (since I only play this game).
The modules to issue the translation have been coded directly inside the .py file, so there's no need for other external library (more portability)

If you have any other ideas, please just post them below ^^

Offline MordyT

  • Moderator
  • Hero Member
  • *
  • Posts: 3644
  • Over $300 Donated to B3!
    • MordyT
Re: Translators plugin
« Reply #26 on: June 04, 2012, 08:40:25 PM »
I like a LOT what you have done to this plugin.

The only other thing is if you gave the ability for someone to use the paid google translate api as well (i mentioned this in my post just 5 or so up from here) it would make it perfect. But don't hold off a release on that...
Help will be given to those with a b3.log

If drop off the map it is due to RL becoming busy :)

System: Python 2.7.3 - Deb 7 - B3 Source Code - 128MB RAM box (rented at $5 a year) - remote MySQL - Remote Web Services

Offline Prez

  • Beta Testers
  • Full Member
  • *
  • Posts: 118
    • cgs-clan.com
Re: Translators plugin
« Reply #27 on: June 04, 2012, 09:23:46 PM »
Looking forward to using it! Nice one  ;)

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 981
    • GitHub
Re: Translators plugin
« Reply #28 on: June 05, 2012, 01:07:33 AM »
I like a LOT what you have done to this plugin.

The only other thing is if you gave the ability for someone to use the paid google translate api as well (i mentioned this in my post just 5 or so up from here) it would make it perfect. But don't hold off a release on that...

Well, I think there's no need of using the paid API service trust me ^^ btw I would like to publish the plugin tomorrow as a 'beta' version (I'll upload it on my server and give u an URL to download it) so all of you can test it on different games. When it will be totally bug free i will publish in the download section

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 981
    • GitHub
Re: Translators plugin
« Reply #29 on: June 05, 2012, 02:04:44 AM »
Plugin release (beta version): http://www.goreclan.net/public/b3_translator_plugin_beta.zip

As specified this is a beta version and contains some bugs, mostly related to special chars that UrT console is not able to display (like umlauts or accents). I tried to replace those chars as much as possible bu sometime i got a translation with missing chars (only while using Italian though).

In order to be able to use both the traslator API you need:

Google: Use a UNIX based operating system (if you wanna know the reason watch the function translateWithGoogle inside the .py file)
Microsoft:

1) Register a Windows Live ID -> https://signup.live.com/
2) While logged with your Windows Live ID, create an Account on the Azure Data Market -> https://datamarket.azure.com/developer/applications/
3) Go to the Microsoft Translator Data Service and Pick a Plan (The free one is 2.000.000 chars each month) -> https://datamarket.azure.com/dataset/1899a118-d202-492c-aa16-ba21c33c06cb
4) Register an Azure application ->https://datamarket.azure.com/developer/applications
5) While registering the new application u need to specify a "valid" website and a "valid" software name. You can just use as website "https://localhost" and as software name.....well you can enter whatever you want (we do love microsoft ^^ xD)

The Azure Application registration, provides two critical fields for API access:

Client ID
Client Secret

Put those credentials inside the plugin .xml config file (be sure not to add spaces before and after)

As I explained above the translation can be issued using both the Traanslator Services (just in case the 1st one fail and the 2nd one is enabled). Actually I suggest to use Google as favourite translatore since it's for "free" and the translation require less time.

Waiting for a feedback

-------

Almost forgot. Unlike SvaRoX plugin the char to separate lang codes in the !trans function is * (changed from |). I did this because in UrT the key | is used to open the console and if you are using an optimized binary (Mitsu build) you are not able to type this char
« Last Edit: June 05, 2012, 02:09:52 AM by Mr.Click »

 


Rate this page +1 at Google Search

anything