search -  faq -  rulez -  staff

forums






map cycle
irc              pwnalizer
voice         dswp bar




Register

Login


It is currently 12.21.24

 

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: [B3] Translators Plugin
PostPosted: 08.26.10 
Offline
Leader
User avatar

Joined: 11.29.08
Posts: 1972
I've just released the first version of my Translators plugin for B3. Have fun :)

Description:
This plugin allows players to translate text on the chat without even leaving their favorite game server. It's dedicated to people who are not confident with foreign languages, who don't want to lose time into translation to communicate or those who just want to have fun with foreign friends.

Features:
- translates text from and to any language supported by Google Translate.
- automatic chat translation. If a chat line is detected to be written in a "foreign" language, the text is translated and dislplayed.

Commands:
- !trans [src lang|dest lang] <sentence> : translates a sentence (use @trans to make the translation available to everyone).
- !translast : translates the latest available sentence from the chat.
- !transauto : enables/disables automatic translation feature.
- !transversion : displays plugin version.

How to use !trans:
The source language parameter is optional and should be used if language auto-detection fails. The destination language parameter is optional, use it if you don't want to translate into the default language.
- example 1, language auto-detection, default destination language :
!trans Sentence to translate
- example 2, language auto-detection, given destination langyage :
!trans |nl Sentence to translate
- example 3, given source language, default destination language :
!trans fr| Phrase a traduire
- example 4, given source and destination languages :
!trans fr|de Phrase a traduire

Installation:
- copy the directory "xgoogle" into your b3 root directory.
- copy the file "xjson.py" into your b3 root directory (optional if you use geowelcome plugin).
- copy the file translators.py into b3/extplugins.
- copy the file translators.xml into b3/extplugins/conf.
- add the following line into the plugins section in b3.xml : <plugin name="translators" config="@b3/extplugins/conf/translators.xml"/>

Configuration file:
- settings/autotranslation : activates automatic translation at startup.
- settings/autothreshold : sets the minimum sentence size required to translate it automatically (also used by !translast).
- settings/translatecmd : if set to 1, also translates chat lines starting with a B3 command.
- settings/defaultsrclang : sets default source language (optional).
- settings/defaultdestlang : sets default destination language.

Notes:
- translations may be inaccurate, use it at your own risk.
- for a list of available languages see http://translate.google.com and http://www.google.com/cse/docs/resultsx ... untryCodes for country codes.
- special characters like accented letters or cyrillic are not displayed.
- the plugin name is Translators, with a final 's'.
- keep in mind that this plugin produces additional network traffic to get the results from Google Translate.
- the translation function can be used in other plugins. Just load the Translators plugin first :
Code:
     self._translators = self.console.getPlugin('translators')
     if not self._translators:
         self.debug('Could not find Translators plugin')

Then use translate() method within try-except block :
Code:
     try:
        msg = self._translators.translate('Sentence you want to translate')
     except:
        pass

Same language parameters as the !trans command can be set, for example translate('|es Sentence you want to translate').
- this plugin can be used as a command-line translator. Add your B3 directory path to the PYTHONPATH shell variable, then run the plugin by typing python translators.py.

Forum thread:
http://www.bigbrotherbot.net/forums/rel ... rs-plugin/

Download link:
http://www.bigbrotherbot.net/forums/dow ... ew;down=86

Thanks:
- Google Translate : http://translate.google.com
- xgoogle python library by Peteris Krumins: http://www.catonmat.net/blog/python-lib ... translate/
- DSWP community (http://www.dswp.de) and other Urban Terror players for testing.

_________________
ut4_he_tennis_v0.1
-------------------------
"We are talking about computers here, compared to those I can read women like a book ;P"
Unclefragger



 


Top
 Profile  
 
PostPosted: 08.27.10 
Offline
Godlike
User avatar

Joined: 03.15.10
Posts: 1132
Location: Nijmegen
did we not already hav a translator plugin? i accidentally activated it once :|
anyways nice =)

_________________
Quote:
tiru: i do sounds like an alien



 


Top
 Profile  
 
PostPosted: 08.27.10 
Offline
Leader
User avatar

Joined: 11.29.08
Posts: 1972
Yes, I officially released it :)

_________________
ut4_he_tennis_v0.1
-------------------------
"We are talking about computers here, compared to those I can read women like a book ;P"
Unclefragger



 


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Imprint

Powered by phpBB © 2000, 2002, 2005, 2007, 2008, 2009, 2010 phpBB Group

Skin by Lucas Kane
we use apache2 mod rewrite with phpBB SEO
map train_beta1-100 © 2009 by SteveMcQueen
Statistics Backend + Database by XLR Stats and B3 Bot
mapvote robot and gameserver monitor © 2009 by BlinKy
mumble viewer Copyright © 2008 Dominik Radner (aka Urmel)
mumble switcher and integration © 2008 by XTJ7, Unclefragger and Wursti
Localisation Plugin © 2009, Team Leads Plugin © 2009 and Knifer Plugin © 2009 by SvaRoX
for our stats we use Chart.js Copyright (c) 2013-2015 Nick Downie.
the stats also use some jQuery jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc.



voice server
top 20 players


nameskillkills
-Dws.BLINGBLING*-*1730.63418631
NormaSnockers1865.75400492
Zottel1760.8276378
make.them.suffer1846.17269872
>8v=1825.35230156
moon1777.56195615
sjas1692.49192315
peace1878.86190660
Wagner_Moura1562.9188001
Goomba1859.75182677
z0rn1608.41181016
Mad1803.76179124
[dswp]PLZ1847.85178516
Graf_ZahlIII1835.73167407
Zohan1611.07159737
ubercunt1634.93159240
Yarrr!1917.33156233
I_am_nOOb1909.64151268
Pandageddon1891.75148319
Pirat1664.08145798