intllib icon indicating copy to clipboard operation
intllib copied to clipboard

Method for instant translation

Open BrunoMine opened this issue 7 years ago • 4 comments

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!

BrunoMine avatar May 09 '17 15:05 BrunoMine

I was discussing with some friends, it will be necessary for the method to return an alternative string (untranslated)

BrunoMine avatar Jun 25 '17 17:06 BrunoMine

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.

ShadowNinja avatar Jun 27 '17 03:06 ShadowNinja

I understand, but the main goal is to translate formspec and chat messages.

BrunoMine avatar Jun 27 '17 15:06 BrunoMine

I'll use this in adventure quests, wiki and chat mensages alert for server players. It will greatly facilitate the gameplay.

BrunoMine avatar Jul 13 '17 17:07 BrunoMine