Spaces:
Build error
Build error
File size: 865 Bytes
d46f4a3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
package net.minecraft.client.resources.language;
import java.util.IllegalFormatException;
import net.minecraft.locale.Language;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class I18n {
private static volatile Language language = Language.getInstance();
private I18n() {
}
static void setLanguage(Language p_118942_) {
language = p_118942_;
}
public static String get(String p_118939_, Object... p_118940_) {
String s = language.getOrDefault(p_118939_);
try {
return String.format(s, p_118940_);
} catch (IllegalFormatException illegalformatexception) {
return "Format error: " + s;
}
}
public static boolean exists(String p_118937_) {
return language.has(p_118937_);
}
} |