[GH-ISSUE #768] Implement machine translations for chat messages #69

Closed
opened 2026-02-15 15:54:51 -05:00 by yindo · 2 comments
Owner

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:

  • DeepL (the free tier). See this page for details on their free plan and its limitations.

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 en
      or
    • !tl me auto en
  • bot 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:

    @dio-gh wrote:

    nem beszélek angolul tesó

    Detected source language: Hungarian. Attempted machine translation is as follows:

    I don't speak English bro

  • 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

    • the bot may hit the "max char length per message" limit of discord
    • takes up more space in the chat
  • 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 time

  • the 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 og or !tl og <message url>)

    Example for how a cut-down translation-only message would look like:

    @dio-gh wrote (in Hungarian):

    I don't speak English bro

  • 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:

    @dio-gh Bot moderator @dio-gh has turned on machine translation for your messages. All your messages from now on will be automatically removed, and a translated version will be posted instead by me, the server's bot. We'd much appreciate if you would turn this off using !tl me off and either switched to English, or used the DeepL translator instead, on your own. Thank you.

    @dio-gh A bot moderátor @dio-gh bekapcsolta a gépi fordítást az üzeneteidhez. Mostantól kezdve minden üzenetedet automatikusan eltávolítjuk, és helyette egy lefordított változatot teszek közzé én, a szerver botja. Nagyra értékelnénk, ha ezt kikapcsolnád a !tl me off segítségével, és vagy angolra váltanál, vagy a DeepL fordítót használnád helyette, saját magad. Köszönjük.

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! 🍻

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:** - DeepL (the free tier). See [this](https://support.deepl.com/hc/en-us/articles/360019358899-Access-to-DeepL-s-API) page for details on their free plan and its limitations. **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 en` or - `!tl me auto en` - bot 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: > @dio-gh wrote: > > nem beszélek angolul tesó > > Detected source language: Hungarian. Attempted machine translation is as follows: > > I don't speak English bro - 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 - the bot may hit the "max char length per message" limit of discord - takes up more space in the chat - 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 time - the 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 og` or `!tl og <message url>`) Example for how a cut-down translation-only message would look like: > @dio-gh wrote (in Hungarian): > > I don't speak English bro - 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: > @dio-gh Bot moderator @dio-gh has turned on machine translation for your messages. All your messages from now on will be automatically removed, and a translated version will be posted instead by me, the server's bot. We'd much appreciate if you would turn this off using `!tl me off` and either switched to English, or used the [DeepL](https://www.deepl.com/translator) translator instead, on your own. Thank you. > > @dio-gh A bot moderátor @dio-gh bekapcsolta a gépi fordítást az üzeneteidhez. Mostantól kezdve minden üzenetedet automatikusan eltávolítjuk, és helyette egy lefordított változatot teszek közzé én, a szerver botja. Nagyra értékelnénk, ha ezt kikapcsolnád a `!tl me off` segítségével, és vagy angolra váltanál, vagy a [DeepL](https://www.deepl.com/translator) fordítót használnád helyette, saját magad. Köszönjük. 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! :beers:
yindo added the enhancement label 2026-02-15 15:54:51 -05:00
yindo closed this issue 2026-02-15 15:54:51 -05:00
Author
Owner

@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

@13xforever commented on GitHub (May 17, 2021): deepl api access requires pro account, which is available [only in select countries](https://www.deepl.com/pro#developer) I have evaluated other options in the past, and the only feasible option right now is [bing language tools](https://azure.microsoft.com/en-us/services/cognitive-services/translator/) (which can also detect language as a separate call), but the quality of this service is...not great
Author
Owner

@dio-gh commented on GitHub (Oct 3, 2021):

I changed my mind on this.

@dio-gh commented on GitHub (Oct 3, 2021): I changed my mind on this.
yindo changed title from Implement machine translations for chat messages to [GH-ISSUE #768] Implement machine translations for chat messages 2026-06-05 15:25:09 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RPCS3/discord-bot#69