mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-07-21 01:05:27 -04:00
[GH-ISSUE #768] Implement machine translations for chat messages #69
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dio-gh on GitHub (May 16, 2021).
Original GitHub issue: https://github.com/RPCS3/discord-bot/issues/768
This fun idea came up just a couple hours ago, after a Spanish storm that occurred on the main channel.
Proposed service to rely on:
Service level limits:
max. 500 000 chars per month
response latency is ??? but also worse than the paid tiers'
Proposed usage:
user starts speaking in <foreign language supported by the machine translator backend>
we can tell them to either abide rule 4 or to enable message translations via a command, like so for example:
!tl me es enor
!tl me auto enbot moderators can assign a language to them the same way (
!tl @nickname es en)the user should always be able to turn auto translations off (e.g.
!tl me off)original message is deleted by the bot, the bot posts a translated version (with the original inlined) instead:
if a moderator enables this while also replying to an earlier message, this should be taken as a hint that all messages from that user who was replied to from that message and on is in that foreign language, and should be translated in bulk right away
Possible shortcomings and concerns:
this makes it impossible to directly reply to the user
it is possible to abuse this as a translation service (turning the bot translation on, saying one message, turning it back off)
the response latency is unknown and unguaranteed, meaning it may be unsuitable for real-time communication
retaining the target text makes messages twice as big, which means
putting in the user's mention without pinging them requires posting without it first, then putting that line in
the bulk sequential translations might need splitting to several messages due to length concerns, and it may also cause a flood of messages
this is kind of a notable effort just to curb lazy/dumb people not using a translator themselves
this only works in one direction at a time, so the foreign user still won't understand what we are saying to them, only we will what they're saying to us
Possible counters for these shortcomings and concerns:
you can always just ping the user instead of using the reply function if it's oh so needed
this can be easily checked against, and the user can be auto-warned while advising them to not do this
gotta test, could put up a temporary placeholder message such as
Translating...and not deleting the og msg for that timethe original message could be not included - this might cause issues if the translation is incorrect or incomplete, though a command could be added to reveal the og msg in those cases with an edit (e.g.
!tl ogor!tl og <message url>)Example for how a cut-down translation-only message would look like:
this is doable, there might be other ways of inactive mentions too though
the moderator can choose to not click on the reply button when assigning a language to a user, so this is a people problem
but it's also kinda fun
we ourselves could turn on translations to their target language for the period of interaction, maybe even limiting it by channel (e.g.
!tl me en es in #rpcs3) and a message could also be prompted to the user (with a proper ping) in both languages that their messages are going to be machine translated until they turn it off (and that we'd much appreciate that, as they could use DeepL on their own instead)Such a message could look like this for example:
I think I covered most, if not all, bases. Haven't checked out Google Translate's API, could also be an option if DeepL ends up being unsuitable (e.g. due to latency issues). Cheers! 🍻
@13xforever commented on GitHub (May 17, 2021):
deepl api access requires pro account, which is available only in select countries
I have evaluated other options in the past, and the only feasible option right now is bing language tools (which can also detect language as a separate call), but the quality of this service is...not great
@dio-gh commented on GitHub (Oct 3, 2021):
I changed my mind on this.
Implement machine translations for chat messagesto [GH-ISSUE #768] Implement machine translations for chat messages