Finished language localizer and added a description to it.

This commit is contained in:
tosta3000
2015-11-05 09:44:02 +01:00
parent 8dbffd4dc9
commit 9aacabba58
4 changed files with 13 additions and 8 deletions
@@ -17,6 +17,7 @@ import de.skate702.craftingkeys.config.GuiConfig;
import de.skate702.craftingkeys.config.GuiConfigHandler;
import de.skate702.craftingkeys.manager.*;
import de.skate702.craftingkeys.proxies.CraftingKeysProxy;
import de.skate702.craftingkeys.util.LanguageLocalizer;
import de.skate702.craftingkeys.util.Logger;
import de.skate702.craftingkeys.util.Util;
import net.minecraft.client.gui.GuiEnchantment;
@@ -3,12 +3,14 @@ package de.skate702.craftingkeys.util;
import net.minecraft.util.StatCollector;
public class LanguageLocalizer {
//TODO: Finish localizer
public static String localizeIfPossible(String unloc){
String localized = "";
if(StatCollector.canTranslate(unloc)){
localized = StatCollector.translateToLocal(unloc);
}
/**
*If another language than de_DE or en_US is selected the English one is used...
*
* @param unloc The unlocalized string which is in the definded in the language file
* @return localized The localized String
*/
public static String localize(String unloc){
String localized = StatCollector.translateToLocal(unloc);
return localized;
}
}