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}%"
is for arguments. You can give infinite arguments but the triton translation needs to contain those argument positions (
%1 %2 %3 etc.)
Command:
test is my message key.
argument1 and
argument2 are my arguments
Result:
2: Get Player Language
Code (YAML):
command /langfrom [<offline player>]:
trigger: message player's lang
This expression will return the player's selected language as country code.
Command:
German is my currently selected language so the result is
de_DE
Result:
3: Set Player Language
Code (YAML):
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:
German is my currently selected language but I changed it to
en_GB so the result is
en_GB now