Raised This Month: $32 Target: $400
 8% 

Translator Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
headline
SourceMod Moderator
Join Date: Mar 2015
Old 06-22-2017 , 00:32   Re: Translator Plugin
Reply With Quote #11

I mean you're not wrong with the fact that it's a workaround, but it's a workaround that is free and usable. The good thing about it being a web interface is that if it were to break we could always switch the php backend without the plugin failing.
headline is offline
Addicted.
AlliedModders Donor
Join Date: Dec 2013
Location: 0xA9D0DC
Old 06-22-2017 , 09:06   Re: Translator Plugin
Reply With Quote #12

Quote:
Originally Posted by Headline View Post
I mean you're not wrong with the fact that it's a workaround, but it's a workaround that is free and usable. The good thing about it being a web interface is that if it were to break we could always switch the php backend without the plugin failing.
Yeah, the only reason I say that is because many people don't have their own webserver for a plugin like this.
Addicted. is offline
headline
SourceMod Moderator
Join Date: Mar 2015
Old 06-22-2017 , 10:34   Re: Translator Plugin
Reply With Quote #13

Quote:
Originally Posted by Addicted. View Post
Yeah, the only reason I say that is because many people don't have their own webserver for a plugin like this.
True! Mine will always be up for them tho
headline is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 03-24-2018 , 02:38   Re: Translator Plugin
Reply With Quote #14

Here a working plugin https://forums.alliedmods.net/showthread.php?t=306279
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 03-24-2018 , 12:39   Re: Translator Plugin
Reply With Quote #15

Here a generator tool to make sourcemod plugins with multi-language support using this -> https://forums.alliedmods.net/showthread.php?t=306293
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
foxhound27
AlliedModders Donor
Join Date: Sep 2019
Location: Argentina
Old 12-08-2021 , 04:42   Re: Translator Plugin
Reply With Quote #16

Hello headline, you might wanna use official api. which is free

PHP Code:
Handle CreateRequest(char[] inputchar[] targetint client)
{
    
Handle request SteamWorks_CreateHTTPRequest(k_EHTTPMethodGET"http://translate.googleapis.com/translate_a/single");
    
SteamWorks_SetHTTPRequestGetOrPostParameter(request"client""gtx");
    
SteamWorks_SetHTTPRequestGetOrPostParameter(request"dt""t");    
    
SteamWorks_SetHTTPRequestGetOrPostParameter(request"sl""en");//from en default, so you might wanna add this param too to modify.
    
SteamWorks_SetHTTPRequestGetOrPostParameter(request"tl"target);//to desired.. target language
    
SteamWorks_SetHTTPRequestGetOrPostParameter(request"q"input);//input text

    //final url would be something like this  https://translate.googleapis.com/translate_a/single?client=gtx&dt=t&sl=en&tl=es&q=hello
    //response example [[["Hola","hello",null,null,10]],null,"en",null,null,null,null,[]]  so we need to parse json on Callback_OnHTTPResponse >  JSON.parse(response)[0][0][0] = Hola
    
    
SteamWorks_SetHTTPRequestContextValue(requestGetClientUserId(client));
    
SteamWorks_SetHTTPCallbacks(requestCallback_OnHTTPResponse);
    return 
request;

foxhound27 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode