TransChat | Chat Translation Plugin

Source Code now available on the GitHub page.

The premise is quite simple.

  1. Listen for message.
  2. Check sender’s/receiver’s language setting.
    a. If the languages match, do nothing.
    b. If the languages don’t match, translate from sender’s language to receiver’s language.

Just trying to gauge the interest in a plugin which would make this happen. No actual guarantee of pursuing this project.

6 Likes

gTranslate has an API that this plugin could tap into. I haven’t played much with it, but it’s possible to send it strings and the language from/to, or to autodetect language from.

Adding on, the default language could default to a config-preset locale, and onFirstJoin if could ask if they want that language or not. Of course, not forgetting the on-the-fly changing with commands. would it translate from then on, or resend a few lines from chat from before the command to translate the currently “visible” chat?

2 Likes

It might be hard to translate “chat language” with translation software like Microsoft Translator or Google Translate.

I like the idea!

1 Like

Sounds like it has potential. I’ll look into it, if I decide to work on this (and recommend it to anyone who may decide to do this in my stead).

Maybe also a setting which sets all translations to a certain language, but allows users to type in whatever they wish? Such as pure-english servers, and so on.

Not sure what you mean. Are you suggesting some sort of system for message prefix compatibility?

Of course, no system I could make (or know of) could provide a 100% translation for, as @octoshrimpy calls it “chat language”. However, I’d imagine anyone who wishes to use this plugin in an environment where this plugin would get a lot of use would come into it with that knowledge beforehand.

Maybe a disclaimer though, just to be sure? :stuck_out_tongue:

Imagine this as chat:

octo: I very much enjoy this plugin idea, Ferous!
FerousGrim: I know, right? It’s a great idea!

/translate portuguese

would the command translate the messages AFTER you issue the command, or would it keep track of the 3 or 4 messages prior to the command, and translate AND RESEND the entire “visible” chat (previous 5-8 messages) from before the command, so that in effect, using the above example, it would also translate:

“I know, right? It’s a great idea!”

–EDIT–
imagine it as keeping track of the current lines of chat in an array, and then cls, translate, print chat[ i ] (to put it super simple)

Ah - that’s an interesting idea. With Bukkit, there was no way to get the previous ‘x’ messages. There’s no reason Sponge couldn’t do this, but I doubt it’s a feature that warrants addition.

However, we could always keep track of that on our own…

Unfortunately, there would be no way to literally modify the text the user sees that have already been sent. It would have to appear as something like

[quote]FerusGrim: I know, right? It’s a great idea!
/trans portugese 1 // 1 being the number of previous lines to translate.
(Translated) FerusGrim: Eu sei direito? É uma ótima idéia![/quote]

Maybe two different commands?

trans to translate previously typed comments.
lang to translate future messages automatically.

The plugin could have a thingydoodler where it substitutes chatLang into english, like:

“r u ok” → “are you ok” | “thx” → “thanks” | “fck u” → “I’m sorry”

1 Like

I really like this idea. Though there’s a limit rate for the free tier of most translation APIs.

An other possibility would be to add basic pre-translated messages that the users can send and the server handles to display it in the correct language for you. A good share of mmos do that. In FFXIV:ARR for example, I can easily ask help in the chat through a preset phrase and it’s gonna look something like [FR].

So rather than translating after, you could unify it before.

If you send them 15 lines of " " and then resend the chat again, but translated this time. :wink:

Definitely, yeah. Only so much of that we can cover, though.

I’d also want to have a config setting for us modifying chat like that. It would be slightly invasive to do such an action automatically.

That’s true. On a lot of servers, though, I personally use chat logs for things. Especially moderation. This wouldn’t be a fix-all solution, and doing it the way I previously suggested may be better.

ForcedGrammar, you horrible fiend. Agreed. maybe prefix messages with \ or some other char would tell it not to translate/transmogrify?

It would be big, and it grammar would be horrible, but I guess we could add dictionary files that pull translations to avoid the limits?

maybe add in commands like

/help fr [thing you need help with]

and it would show

octoshrimpy besoin d’aide avec [thing you need help with, translated to french]

PS: I haven’t ran into any limits with gTranslate yet.

I haven’t taken a look at it yet, but just thinking about it makes me think we’d likely have to do this asynchronously. Then again, chat is already handled off-thread, right?

edit: off-thread meaning, obviously, off-main.

This runs into the same problem as “chat language”. Not discounting the idea, but it would most likely rely off of the optional configuration to, as @octoshrimpy said, “Force Grammar”.

1 Like

Edited my post above, and you guys ninja’d me. pls read back. <3

Not exactly, from what I’ve see there’s usually around 20 common phrases in 5-10 languages. That dictionnary would be pretty light and enabling a language would be an option for the server owner. They could also add their own phrases.

If I recall the limit is at 25k words per day.

.

1 Like

Sounds like that won’t work. local dictionaries might be the best idea.

You don’t have a problem with chat language as only the phrases available in the dictionnary are available.
Say you need help and you speak Spanish, you type:

/tsay help

A French player sees : [ES] Kornagan a besoin d’aide!
An English player sees: [ES] Kornagan needs help!

1 Like

SO the dictionary contains predefined phrases, instead of the -entire- dictionary with every word in that specific language. Ok, I see where you’re going with this. :slight_smile:

It’s far from perfect but that’s own asian mmos handles it.