Chat Translator
Chat Translator
Chat Translator
About
This plugin simply translates the chat between languages so any player can understand what any other player says.
How it works
The player sets their language, or it is set to the default language (set in the config) or detected automatically. This is then used by the plugin to use the Yandex translation API to translate the chat.
Requirements
You will need:
- A FREE api key from https://tech.yandex.com/keys/get/?service=trnsl
- Optional, an SQL server to use to save a player's language. (Can work across servers, eg. in a network)
Will this break my chat plugins?
This plugin is designed to override the chat almost entirely, so it most likely will. HOWEVER there is an API which can be used by developers to use the power of the plugin's translation without overriding the chat. You can turn off chat translation in the config.
The API (For developers to read)
The API allows you to:
- See a player's set language
- Set a player's language
- Show to players an inventory menu to let them set their own language
- Detect what language some text is written in
- Translate text between languages
- Change between API_KEYs
- Most useful of all, specify custom MessageHandlers to allow for custom chat formatting.
- There is also the ability to make the plugin handle your own custom chat 'events' the same as it would handle bukkit chat events (Even if bukkit chat events are set to not be handled) - This allows you to use this with a custom channel-based chat plugin.
API usage
Full documentation coming soon
All of the API's methods can be accessed using the org.stormdev.chattranslator.api.TranslatorToolkit class.
For example:
//Translate some text String foo = "The quick brown fox jumped over the lazy dog"; try { String translated = TranslatorToolkit.getToolkit() .translate(Lang.ENGLISH, Lang.DUTCH, foo); System.out.println(translated); } catch (Exception e) { //Something went wrong e.printStackTrace(); }
Supported Languages
There are currently 40 supported languages, including all the main ones. If Yandex add support for other languages, I will add those too. For a complete list of supported languages look at the ones available on https://translate.yandex.com/!
Commands & Permissions
Command | Aliases | Permission | Function |
/lang | /language, /setlang, /setlanguage | chattranslator.setlanguage | Shows the player a GUI (Item menu) to select their language |
/lang <en/fr/de/..> | /language <...>, /setlang <...>, /setlanguage <...> | chattranslator.setlanguage | Sets the player's language to the one specified |
/lang <English/French/German> | /language <...>, /setlang <...>, /setlanguage <...> | chattranslator.setlanguage | Sets the player's language to the one specified |
Hello I've got a question witch languages i can use... I need czech, detush, english
WARNING : Don't download this plugin ! It is going to make had bugs the server !
@nathan2439
Yes sadly it seems more recently Yandex has started charging (like every other translator service) although it does allow SOME free works... it also seems to not respond to some requests randomly :( Oh well.... if you can afford it, this plugin works great.
this plugin is pretty amazing the only thing holding it back is how yandex has a limit on "free words"
@CloudeLecaw
Link for the API key now fixed :)
@CloudeLecaw
Yes the usage limit appears to have been added since the creation of this plugin; but 10K is reasonable for some networks/servers and the pricing is pretty reasonable even above 10K.
@GrandmaJamGaming
It is
Is this the API that you use on your server? I was always wondering if that was a custom plugin or what.. xD
@TheGamesHawk2001
This is to do with spigot versioning; I will upload the version of the plugin for the latest spigot build now ;) Also why would it get higher downloads on Spigot? It's better here on bukkit ;P
Can you add to spigot please? It will get a higher download rate there :)
I also get this error:
Caused by: java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/libs/com/googl e/gson/JsonParser at org.stormdev.translator.yandex.translation.YandexConnection.getJSONRe sponse(YandexConnection.java:124) [?:?] at org.stormdev.translator.yandex.translation.YandexConnection.getLang(Y andexConnection.java:74) [?:?] at org.stormdev.chattranslator.main.ChatListener.onChat(ChatListener.jav a:78) [?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [?:1.8.0 _31] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [?:1.8.0 _31] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [?:1 .8.0_31] at java.lang.reflect.Method.invoke(Unknown Source) [?:1.8.0_31] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja va:301) [spigot-1.8.3.jar:git-Spigot-beb883d-234e607] ... 11 more
@U1T1MATE
If you read above then you'll see that the plugin does support changes to the chat format, but due to the nature of this plugin it has to be done by other plugins hooking into chat translator. However potentially in the future I could add a 'format' section to the config :)
Looks like a good plugin, but can you add a way to actually FORMAT the chat? With different groups. For example, maybe hook it with Essentials chat or something.
I want chat messages to look like: &7Member (player)&8: &f(message) Not the ugly way it is now (<(player)> (message))
@hejsamitnavn
Good idea :)
Hey nice plugin, its working. But can you make the plugin to send the messages that players write to the console or the log also? Because when somebody its writing something i cant see it on the console or the log. Sorry for my bad english.
@JacketPotato
Your welcome ;)
Works perfectly for my 1.8.1 server, papicraft.mcalias.com.
Thanks for such an amazing plugin! <3
@Sckaletz
:( Sadly not a lot I can do, sorry.
I'm sorry but the English to Danish part isn't understandable. Sorry to say so.
@Burnsalan18
Go in the config, where it says api key go to that web address, get an api key and then paste it into the config where it said api key :)
@Sckaletz
No automatic translator is 100% accurate :p. But most of this at least is at least understandable.
I love this idea for my server, but after testing it I most say it's simply way to bad at translating. It's completely wrong.