Created
June 24, 2016 21:02
-
-
Save TheCodedOne/ac3fdef07537020ddd0660a581b0c491 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package %groupName%.util; | |
import %groupName%.ModInfo; | |
import net.minecraft.client.resources.I18n; | |
public enum LanguageHelper { | |
MESSAGE("message"), | |
LABEL("label"), | |
BLOCK("tile"), | |
ITEMGROUP("itemGroup"), | |
ITEM("item"), | |
DESCRIPTION("description"), | |
JEI("jei"), | |
NONE(""),; | |
private String name; | |
LanguageHelper(String name) { | |
this.name = name; | |
} | |
public String translateMessage(String message) { | |
if (this.name == "") | |
return I18n.format(message); | |
return I18n.format(String.format("%s.%s.%s", this.name, ModInfo.MOD_ID, message)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment