Phil25 / RTD

Roll The Dice SourceMod plugin for Team Fortress 2
GNU General Public License v3.0
56 stars 20 forks source link

Translations still not working #64

Closed GreatBlank closed 8 months ago

GreatBlank commented 9 months ago

The plugin only uses EN-US language even if you change in-game language.

MAGNAT2645 commented 9 months ago

That's because RTD uses LANG_SERVER for phrases as target to retrieve language. Also some strings still aren't translated at all, just hardcoded.

MAGNAT2645 commented 9 months ago

Functions like RTDPrint, RTDPrintAll, RTDPrintAllExcept should include SetGlobalTransTarget so all %T can be changed to %t.

void RTDPrintAll(const char[] sFormat, any ...)
{
    char sMsg[255];
    for (int i = 1; i <= MaxClients; ++i)
    {
        if (!IsClientInGame(i) || IsFakeClient(i))
        {
            continue;
        }
        SetGlobalTransTarget(i);
        VFormat(sMsg, 255, sFormat, 2);
        PrintToChat(i, CHAT_PREFIX ... " %s", sMsg );
    }
}
Phil25 commented 9 months ago

Hey, sorry I didn't take a look at it for 2.4.0. This kinda relates to #44 so lemme just reference it here.

The reason it's LANG_SERVER is because I saw this being the convention way back in the day when implementing it. I'm gonna have to research the topic of SM translations and see how they're handled basically from scratch, which is one of the reasons I didn't bother with it yet. That alone is not gonna take a long time but I wanna some time for a break because the last update took a lot of time and effort. But suffice to say, this topic is on my radar.

Also some strings still aren't translated at all, just hardcoded.

@MAGNAT2645 can you let me know which ones? All the player facing strings should be translated afaik.

MAGNAT2645 commented 9 months ago

I can do PR but not right now and idk how much changes need to be done. I didnt look at every piece of code yet, just some lines. There are hardcoded strings like this:

RTDPrint(initiator, "%N is already using RTD.", client);

(Cant copy line url in GitHub Mobile) Also some ReplyToCommand messages should be translated as well.

Phil25 commented 8 months ago

Closing this as duplicate of #44, I'll be mentioning that issue with the fix.