Page 1 of 1

[mod] Translate chat using commands [babelfish]

PostPosted: Sun Dec 18, 2016 00:13
by taikedz
License: LGPLv3.0

Download:

github: https://github.com/taikedz/minetest-babelfish
ZIP: https://github.com/taikedz/minetest-bab ... master.zip

    * Currently uses Yandex to do the translation because it was the only free API I could get.
    * Can be extended to use different web APIs
    * Can be used as an API for other mods
    * You MUST add babelfish to the `secure.trusted_mods` for it to work, as it makes calls out to the Internet.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
    /babel {player}
        * Translates the last message from the specified player to your preferred language
        * Only you see the result of this
        * /babel mrGibberish

    /bblang {language}
        * Set your preferred language using a language code
        * Default is English
        * Currently does not save across server reboots

    /bb {language} {sentence}
        * Broadcasts a message in the target language (French in this case)
        * /bb fr My english sentence

    /bmsg {language} {player} {sentence}
        * Sends a private message to another player in the target language
        * /bmsg es spanishplayer I do not understand you, please use the translation commands

    /bbcodes
        * List the available language codes


Still to do (if anyone would like to assist, please do!)

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
    * Saving language preferences
    * Set-lang command for moderators to set a player's language
        * requires privs
    * Special "persistent translations" call so that a phrase is translated once, and stored for later re-use
    * Special command for translating to all players in their preferred languages
        * depends on a temp-persistence being implemented
        * requires privs - this can easily consume the API quota quickly
        * for moderators/admins making announcements

Re: [mod] Translate chat using commands [babelfish]

PostPosted: Sun Dec 18, 2016 09:35
by DS-minetest
nice!

Re: [mod] Translate chat using commands [babelfish]

PostPosted: Sun Dec 18, 2016 13:56
by taikedz
There are quite a few players of various languages on this server, and the mod is running. First day of it going live it seems to hold up well...

minetest.ducakedhare.co.uk : 30002

(Axinite)

If anyone wants to try it in the wild and feeback ....

Re: [mod] Translate chat using commands [babelfish]

PostPosted: Fri Feb 03, 2017 22:22
by taikedz
** finally ** got around to fixing the issues preventing me implementing mod security

You can now turn on mod security and this should work fine. Sorry it took a while.

Re: [mod] Translate chat using commands [babelfish]

PostPosted: Mon Mar 20, 2017 23:03
by octacian
[DELETED]

Someone else was on my computer.

Re: [mod] Translate chat using commands [babelfish]

PostPosted: Tue Mar 21, 2017 14:17
by DS-minetest
This mod could be made clientside.

Re: [mod] Translate chat using commands [babelfish]

PostPosted: Tue Mar 21, 2017 14:46
by octacian
In the future, yes, it'd work great client-side. At this point, though, it is best to remain as is. If I remember correctly, client-side MT still is missing and HTTP request API (and may never get one), and it does not have the features to properly intercept chat messages yet.

Re: [mod] Translate chat using commands [babelfish]

PostPosted: Tue Mar 21, 2017 17:16
by taikedz
I disagree about the client-sidedness of this:

For one, the code reaches out to the wider Internet (over HTTP), requiring privileged access. This is not something you want users to go trust blindly, and I doubt we'll be introducing code-signing on mods anytime soon (because a/ it defeats the paradigm of free modding and b/ nobody will care enough to check what they're accepting to run anyway)

Secondly, the server-side implementation of this ensures that translations happen once and then are broadcast, and it is possible to control what is displayed under what conditions, rather than a user simply spewing out a heap of translations from their client and telling the server who they are for. It's a game server, not an email relay.

Case in point, I'm still working on making it so that a babel-enabled chat message initiated from a sender is received in the right language for the recipient players, and only translating once per language.

There are other threads on the topic solely of client-side scripting, so I will not elaborate here.

Re: [mod] Translate chat using commands [babelfish]

PostPosted: Tue Mar 21, 2017 19:02
by azekill_DIABLO
Good Jab Tai! (can i call you like this idk to write your name)

it might be very useful forinternational servers!

Re: [mod] Translate chat using commands [babelfish]

PostPosted: Tue Mar 21, 2017 19:09
by taikedz
Yeah - International servers is the goal for this mod :-)

PS -Et bien sur appelle-moi Tai, c'est encore plus simple qu'un pseudo :-P

PPS - "jab" c'est un poinçon, ou un bonne gauche rapide dans les côtes ;-)

Re: [mod] Translate chat using commands [babelfish]

PostPosted: Fri Mar 24, 2017 17:50
by azekill_DIABLO
ha. oups. t'as du avoir mal :)