Evie Addon Details

Watch - Add Favorite

SourceTranslator - Version 1

posted on 2009-07-01 11:42:41
by SuperDave
15
w00ts
w00t!
Requires: Tags: chat css translate translator

Description

Translates chat on-the-fly based on each player's language setting. Requires only ES 2.0.0.250i+

Options/documentation:
// SourceTranslator release 1 options
// ./addons/eventscripts/sourcetranslator/sourcetranslator.cfg
// http://addons.eventscripts.com/addons/view/sourcetranslator
 
// Load this addon with: es_load sourcetranslator
 
 
// To configure language settings for SourceTranslator please see sourcetranslator_languages.ini
 
 
// Translations provided by: Yahoo! translator (http://babelfish.yahoo.com/)
 
 
// ***** A word about translations *****
 
// Translations are not perfect!
// - Translation is performed by Yahoo! translator and as such does not provide perfect translations.
 
// Translations are not instant!
// - The process of connecting to the translator, having the text translated, and retrieving the result is
// not an instant process. When text is translated the time taken to translate will be displayed so players
// know when the original message was sent.
 
// Translations cannot always be displayed properly!
// - Some translation results contain characters unrecognized by the Source engine. SourceTranslator will attempt
// to display those characters using the 26 letter, a-z alphabet.
 
 
// ***** Ignore prefix options *****
 
// Chat prefixes that mark text as not to be translated
sourcetranslator_ignoreprefix "@!"
 
 
// ***** Say command options *****
 
// Use the following server command to specify say commands to be ignored:
 
// sourcetranslator_addsaycmd <"command">
 
 
// Place your sourcetranslator_addsaycmd commands below:
 
 
// Uncomment the following example options if you wish to use them:
 
// sourcetranslator_addsaycmd "!rank"
// Uncomment the above line to ignore lines that start with "!rank"
// sourcetranslator_addsaycmd "!admin"
// Uncomment the above line to ignore lines that start with "!admin"
 
 
// Designated say commands can be removed with the following server command:
 
// sourcetranslator_removesaycmd <"command">
 
// Due to the fact say commands can be added or removed removed above, this command will not be used by most users.
 
 
// ***** ESP functionality documentation *****
 
// SourceTranslator allows other ESP addons to access its translation functionality.
 
 
// SourceTranslator must be loaded to use the translation function:
 
// import es
// translator = es.import_addon('sourcetranslator')
 
 
// You can then request a translation using:
 
// translator.requestTranslation(callback, text, from_lang, to_lang, a=(), kw=None)
 
// callback - function to call when translation is complete
// text - text to translate
// from_lang - two-letter language abbreviation of originating language (usually returned by playerlib's myPlayer.lang)
// to_lang - two-letter language abbreviation of target language
// a - extra arguments to pass to the callback function (requires a tuple, similar to gamethread)
// kw - keywords to pass to the callback function (requires a dictionary, also similar to gamethread)
 
 
// The callback function is called with the following parameters:
 
// callback(text, *a, **kw)
 
// text - the result of the translation
// *a - an expanded version of "a" sent to requestTranslation where tuple elements become arguments
// **kw - an expanded version of "kw" sent to requestTranslation where dictionary keys/values are passed as keywords to the function as: key=value


Please see the forum link below if you have questions or comments.

---

You can visit this CS:S server to see SourceTranslator in action: steam://connect/208.100.20.229:27015

Installation

Install with:
es_install sourcetranslator
Load once for sourcetranslator.cfg to appear:
es_load sourcetranslator
Configure your options in sourcetranslator.cfg and then reload the addon.

Version Notes For 1 (Announce this update)

Updated on: 2009-07-01 11:46:10 EST by SuperDave
- Initial release
( Previous Versions )