package net.minecraft.src;

import net.lax1dude.eaglercraft.EagRuntime;

import java.io.IOException;
import java.util.Properties;

public class StringTranslate {
	private static StringTranslate instance = new StringTranslate();
	private Properties translateTable = new Properties();

	private StringTranslate() {
		try {
			this.translateTable.load(EagRuntime.getRequiredResourceStream("/lang/en_US.lang"));
			this.translateTable.load(EagRuntime.getRequiredResourceStream("/lang/stats_US.lang"));
		} catch (IOException var2) {
			var2.printStackTrace();
		}

	}

	public static StringTranslate getInstance() {
		return instance;
	}

	public String translateKey(String var1) {
		return this.translateTable.getProperty(var1, var1);
	}

	public String translateKeyFormat(String var1, Object... var2) {
		String var3 = this.translateTable.getProperty(var1, var1);
		return String.format(var3, var2);
	}

	public String translateNamedKey(String var1) {
		return this.translateTable.getProperty(var1 + ".name", "");
	}
}
