Tremulous Forum

Mods => Modding Center => Topic started by: Patriotpie on February 21, 2010, 11:50:28 pm

Title: building in translator
Post by: Patriotpie on February 21, 2010, 11:50:28 pm
I play with a lot of spanish people and my spanish is kind of rough, but I would like to be able to know what they are saying.
I've been using Google's translator thus far. So, I wanted to build Google Translate into Trem. I found this translator:

http://translate.reference.com/translate?query=[%s]&src=es&dst=en&v=1.0 (http://translate.reference.com/translate?query=)

I opted for this translator because it is easy to form a URL, and the resulting page is parseable - unlike with Google Translate, the source of the page changes to reflect the translated text. So, it's easy to form a URL on-the-fly, and the resulting page source is (relatively) easy to parse. Now that I have a program to work with, I need to put this code into the tremulous console. Ideally, it would be a command like

Code: [Select]
\translate text+to+be+translated
The page would be called, source would be parsed, and text would returned to console. (hopefully)



tl;dr: how do i put a program i made into the console
Title: Re: building in translator
Post by: Demolution on February 22, 2010, 02:59:08 am
It needs to be a part of the client itself, meaning you have to compile your own, after you code the function as a part of it. Or you could probably get it working from a qvm somehow, but it doesn't seem very likely.
Title: Re: building in translator
Post by: David on February 23, 2010, 10:48:58 am
I don't think QVM's have access to curl and whatnot, and you wouldn't be able to play on pure servers anyway.

The client already has curl in there, but probably not easy.  And it'll probably hitch while waiting for a response.
Title: Re: building in translator
Post by: MitSugna on February 23, 2010, 02:50:53 pm
I don't think QVM's have access to curl and whatnot, and you wouldn't be able to play on pure servers anyway.

The client already has curl in there, but probably not easy.  And it'll probably hitch while waiting for a response.
qvm has access to whatever you allow. curl can work without blocking other things