intllib
intllib copied to clipboard
Method for instant translation
I am planning to use internationalization on bilingual servers.
I plan to use a function to return a translated string.
An example:
GetS("pt_br", "My great string number @1, @2", val1, val2)
I believe this should already exist in intllib. But I do not know if it's okay to use this out of intllib. So this can be a doubt or a suggestion.
Thank you in advance!
I was discussing with some friends, it will be necessary for the method to return an alternative string (untranslated)
This isn't really possible. Things like item definitions are global, so you'd have to do something like redefining a node in an on_preconnect
call for a particular player -- and then revert it after they've finished loading item definitions. You'd also have to block any other players from joining at the same time as they'd get the same translations. This means that you can't translate descriptions. There's a similar problem with info texts and formspecs in node metadata.
The only reasonable way to support more than one language on a single Minetest server is through engine support.
I understand, but the main goal is to translate formspec and chat messages.
I'll use this in adventure quests, wiki and chat mensages alert for server players. It will greatly facilitate the gameplay.