search -  faq -  rulez -  staff

forums






map cycle
irc              pwnalizer
voice         dswp bar




Register

Login


It is currently 05.20.12

 

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: 1878
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
DSWP Environmental Council Chairman
User avatar

Joined: 03.15.10
Posts: 895
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: 1878
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 1 guest


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:  
cron
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



voice server
tdm » dswp.de:22222
status: online
players: 0/45
map: ut4_abbey
 
bomb » dswp.de:22223
status: online
players: 0/12
map: ut4_tunis
 
jump » dswp.de:22224
status: online
players: 0/10
map: ut4_bstjumps_b4
 
team survivor » dswp.de:22225
status: online
players: 0/20
map: ut4_turnpike
 
siesta » dswp.de:22226
status: offline
btw test the new ajax serwer monitor here!
top 20 players


nameskillkills
RastaSkud1608.38403507
NormaSnockers1782.95356641
Hateyouall1601.33252483
Slevin.Kelevra1714.18189976
Wagner_Moura1562.9188001
Heretic1918.49181665
z0rn1608.41181016
[dswp]Ana1754.25177628
Goomba1710.31172531
Mad1716.4165419
sleepingsun1687.4162804
Zohan1611.07159737
ubercunt1691.1159016
[VR]Amantius1693.89155438
[dswp]Zottel1745.49150878
TG|Deviant1934.94148148
Graf_ZahlIII1695.64136286
ZEBRA(ESP)1598.25134104
DeletedUser0011537.41132992
marshallLaw1744.68128298