TARDIS

TARDIS

228k Downloads

Reverse /tardissay

OrangeC7 opened this issue ยท 1 comments

commented

Describe the feature request

In the show, the TARDIS allows people to understand others no matter what language they are speaking. So, allow players to use the Universal Translator circuit to translate other players' messages, instead of just translating your own messages. Like so:

  • Type /tardisprivatesay [PLAYER] <TARGET_LANGUAGE> <ORIGINAL_LANGUAGE> (You might be able to come up with a better command name, though)
  • Translates the last message(s) sent by [PLAYER] from <ORIGINAL_LANGUAGE> (or, if not provided, attempts to detect language) into <TARGET_LANGUAGE> (or default language set by the player in /tprefs)
  • Requires the permission tardis.translate
  • Config option to set maximum amount of previous messages to translate at once. It would probably be useful to set this to more than just one, so you have more time to translate a message before another one is sent.

Describe alternatives you've considered

It might be possible to implement this without commands so you can translate any message as long as it's still in your chat history. You could include a translation in the on-hover dialog box of a message. In other words, if you receive a message in another language and the plugin detects that, you can hover over the message to see an automatic translation into your language. This could possibly interfere with other on-hover dialog boxes that the message already had attached to it, though, so this may not be an option if the plugin can't avoid overriding them.

Also, this was my original idea before I came up with the other two:

  • When the TARDIS plugin detects a message sent in a language that not all players understand, send the translated message to those players right after the original-language message. For example,
    • A French player sees English messages with French translations beneath them while French messages stay intact
    • A Japanese player sees both the English and French messages with their respective Japanese translations beneath them
    • The English player does not see the French and Japanese translations of their own messages, but sees English translations of the other two players
  • Config option to turn automatic translation on
  • Include TARDIS preferences so each player can set their own native language and turn off automatic translation if they choose. I believe there is also a way to auto-detect a player's language based on what language they have their client set to.

Hopefully this is clear enough, I've already spent way too long trying to get the wording right. ๐Ÿ˜…

commented

The Spigot API doesn't provide any way to retrieve a player's chat history, so the plugin would either need to log chat messages, search the server log for messages sent by a particular player, or hook into a chat plugin to read their chat logs.

Should the feature apply to the /msg, /w or /tell commands as well as general chat? In the case of logs, there would need to be extra processing to tell who the intended recipient(s) of the message is.

You could automatically translate messages on the fly if a player's preferences were set, but this would require various lookups every time a message is sent on the server, and could potentially make chat a bit slower, would have to do some testing.