mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-18 11:29:05 +00:00
More things!
This commit is contained in:
1 parent
6ae6a8afc0
commit
bc596ee3a6
83 files changed
No files matched your search
@@ -0,0 +1,38 @@
|
||||
package magicbees.main.utils;
|
||||
|
||||
import magicbees.main.CommonProxy;
|
||||
import net.minecraft.util.StringTranslate;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
|
||||
public class LocalizationManager
|
||||
{
|
||||
private enum Locale
|
||||
{
|
||||
en_US("en_US"),
|
||||
;
|
||||
public String locale;
|
||||
|
||||
private Locale(String loc)
|
||||
{
|
||||
this.locale = loc;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setupLocalizationInfo()
|
||||
{
|
||||
for (Locale l : Locale.values())
|
||||
{
|
||||
LanguageRegistry.instance().loadLocalization(CommonProxy.TCBEES_LOCDIR + l.locale + ".xml", l.locale, true);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getLocalizedString(String key)
|
||||
{
|
||||
String result = LanguageRegistry.instance().getStringLocalization(key);
|
||||
if (result.isEmpty())
|
||||
{
|
||||
result = LanguageRegistry.instance().getStringLocalization(key, "en_US");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user