AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   In-game translations (https://forums.alliedmods.net/showthread.php?t=332427)

Mr_panica 05-12-2021 07:59

In-game translations
 
Hello everyone.
How can I get a translation for a phrase from the game for a specific language of the player?
I mean phrases that the player already has locally in the game folder.

HTML Code:

public void OnPluginStart()
{
        RegConsoleCmd("sm_trtest", Command_Test);
}

public Action Command_Test(int client, int args)
{
        char tt[27];
        Format(tt, sizeof(tt), "#TF_invasion_pistol");
        PrintToChatAll(". %s", tt);
        PrintToChatAll("%s",tt);
        return Plugin_Handled;
}

Normal PrintToChat * outputs the translation, but only if there are no other characters besides the translation phrase.

https://media.discordapp.net/attachm...36/unknown.png

SHUFEN 05-12-2021 23:22

Re: In-game translations
 
There is no such native. You need to get cl_language from client and to parse txt files for phrases one by one, maybe I think.

Dragokas 05-14-2021 11:24

Re: In-game translations
 
Mr_panica, you can find a parser logic here.


All times are GMT -4. The time now is 15:00.

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