public class MinecraftTranslator
extends java.lang.Object
| Constructor and Description |
|---|
MinecraftTranslator() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
langToUsable()
Gets the usable language key for the local language from Minecraft
|
static java.lang.String |
mcLangCodesToUsable(java.lang.String code)
Gets the usable language key for the given Minecraft language code
|
void |
onChatEvent(net.minecraftforge.client.event.ClientChatReceivedEvent event) |
void |
onTooltipEvent(net.minecraftforge.event.entity.player.ItemTooltipEvent event) |
static java.lang.String |
translate(java.lang.String text,
java.lang.String toLang)
Translates a given text (either from the unlocalized key or from standard text) (prefers Minecraft's translation)
|
static java.lang.String |
translate(java.lang.String text,
java.lang.String fromLang,
java.lang.String toLang)
Translates a given text (either from the unlocalized key or from standard text) (prefers Minecraft's translation)
|
static java.lang.String |
translateToLocal(java.lang.String text)
Simplified method to translate a string to the local language for Minecraft
|
static java.lang.String |
translateToLocal(java.lang.String text,
java.lang.String fromLang)
Simplified method to translate a string to the local language for Minecraft
|
public static java.lang.String translate(java.lang.String text,
java.lang.String toLang)
throws java.io.IOException,
TranslationException
text - String to translatetoLang - Language to translate toTranslationExceptionjava.io.IOExceptionpublic static java.lang.String translate(java.lang.String text,
java.lang.String fromLang,
java.lang.String toLang)
throws TranslationException,
java.io.IOException
text - String to translatefromLang - Language the string is fromtoLang - Language to translate toTranslationExceptionjava.io.IOExceptionpublic static java.lang.String translateToLocal(java.lang.String text,
java.lang.String fromLang)
throws TranslationException,
java.io.IOException
text - String to translatefromLang - Language of the string to translateTranslationExceptionjava.io.IOExceptionpublic static java.lang.String translateToLocal(java.lang.String text)
throws TranslationException,
java.io.IOException
text - String to translateTranslationExceptionjava.io.IOExceptionpublic static java.lang.String langToUsable()
public static java.lang.String mcLangCodesToUsable(java.lang.String code)
code - The Minecraft language codepublic void onTooltipEvent(net.minecraftforge.event.entity.player.ItemTooltipEvent event)
public void onChatEvent(net.minecraftforge.client.event.ClientChatReceivedEvent event)