[mod] Translate chat using commands [babelfish]

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

[mod] Translate chat using commands [babelfish]

by taikedz » Sun Dec 18, 2016 00:13

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
Last edited by taikedz on Fri Feb 03, 2017 22:24, edited 3 times in total.
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

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

by DS-minetest » Sun Dec 18, 2016 09:35

nice!
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

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

by taikedz » Sun Dec 18, 2016 13:56

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 ....
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

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

by taikedz » Fri Feb 03, 2017 22:22

** 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.
 

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

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

by octacian » Mon Mar 20, 2017 23:03

[DELETED]

Someone else was on my computer.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

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

by DS-minetest » Tue Mar 21, 2017 14:17

This mod could be made clientside.
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

User avatar
octacian
Member
 
Posts: 408
Joined: Mon Dec 21, 2015 22:18
GitHub: octacian
IRC: octacian
In-game: octacian

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

by octacian » Tue Mar 21, 2017 14:46

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.
God isn't dead!

My Coolest Mods:
MicroExpansion, Working Computers, Interchangeable Hands

Check out my YouTube channel! (octacian)
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

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

by taikedz » Tue Mar 21, 2017 17:16

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.
Last edited by taikedz on Tue Mar 21, 2017 19:53, edited 1 time in total.
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

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

by azekill_DIABLO » Tue Mar 21, 2017 19:02

Good Jab Tai! (can i call you like this idk to write your name)

it might be very useful forinternational servers!
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

User avatar
taikedz
Member
 
Posts: 587
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake

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

by taikedz » Tue Mar 21, 2017 19:09

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 ;-)
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

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

by azekill_DIABLO » Fri Mar 24, 2017 17:50

ha. oups. t'as du avoir mal :)
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 44 guests

cron