Sueta

Triton - Translate Your Server | Skript integration

1.0

Have you always wanted to use Triton syntax in skript? This skript allows you to do so.

·Plugin

Download Triton:

Triton Website

Examples:
1: Translation

command /translate [<text>] [<text>]:
    trigger:
        set {_t} to arg-1's translation in player's lang if arg-2 is not set
        set {_t} to arg-1's translation in player's lang with (split arg-2 at " ") if arg-2 is set
        message "%{_t}%"
set {_t} to arg-1's translation in player's lang if arg-2 is not set

is for arguments. You can give infinite arguments but the triton translation needs to contain those argument positions ( %1 %2 %3 etc.)

Command:

/translate test argument1 argument2

test is my message key. argument1 and argument2 are my arguments

Result:
upload_2022-5-2_18-44-20.png

2: Get Player Language

command /langfrom [<offline player>]:
    trigger:
        message player's lang

This expression will return the player's selected language as country code.

Command:

/langfrom schrill

German is my currently selected language so the result is de_DE

Result:
upload_2022-5-2_19-2-28.png

3: Set Player Language

command /langfrom [<offline player>]:
    trigger:
        set player's lang to "en_GB"
        message player's lang

This effect will change the player's current language without needing to rejoin or to reload something.

Command:

/setlang schrill

German is my currently selected language but I changed it to en_GB so the result is en_GB now

Result:
New language:
upload_2022-5-2_19-8-23.png

Similar projects

Plugin →