Ye, I am still alive, and I have new updates for OpenWolf:)
I have managed to get connected OpenWolf with Google Translate API v2.
Little more info about features :
Whole process of translations is based on URL, and cvar system.
Engine is capable to hook on Google API site and based on configuration in cvars to detect and detected text to translate on the fly without problems.
To get anything translated to defined output lang. you can just type “/cl_translation 1” inside console, and use “translate <text>” so you can translate text accoring to translateInputLang and translateOutputLang. Ofc whole displaying translation message is based is FreeType fonts where you can load Unicode fonts
cl_translateInputLang = Cvar_Get ("cl_translateInputLang", "auto", CVAR_ARCHIVE);
cl_translateOutputLang = Cvar_Get ("cl_translateOutputLang", "en", CVAR_ARCHIVE);
cl_translateAuto = Cvar_Get ("cl_translateAuto", "0", CVAR_ARCHIVE);
Code example
if (!strcmp(cl_translateInputLang->string, "auto")) {
strcpy(InputLang, "");
} else {
strcpy(InputLang, cl_translateInputLang->string);
}
if (!strcmp(cl_translateOutputLang->string, "auto")) {
strcpy(OutputLang, "");
} else {
strcpy(OutputLang, cl_translateOutputLang->string);
}
url[0] = '\0';
strcat(url, "http://ajax.googleapis.com/ something :) :) :) );
if (received_name) {
Com_sprintf(ShowFinMsg, "^2Translated^7[^2%s^7]^2: ^7%s^3%s
", detected_lang, received_name, final);
} else {
Com_sprintf(ShowFinMsg, "^2Translated^7[^2%s^7]^2: ^3%s
", detected_lang, final);
}
And ofc, this isnt full code
Now about problem Well, if you want to use Google API translation, we would need to pay for API integration, $20 per 1 M characters of text (Translation) and $20 per 1 M characters of text (Language Detection).
I personally believe that this feature will be for test build only defined as API_TRANSLATE inside code and not compiled with it. (To tell truth, if we want this feature inside Openwolf I believe that I will have to pay for that or to get donations, so this be included into working state into build …)
Second feature what I have introduced along with Translation is Unicode font system inside OpenWolf.
Unicode system is based in cvar and fully customized. User can specify color, font, shadows, line, font size, alpha, position … Fully customize system :).