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.
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?
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.
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.
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.
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.
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?
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”.
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.
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!
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.