Custom localization solution for all Minecraft versions.
Minecraft's (and Forge's) language management system is very buggy and inconsistent across several Minecraft versions. This library aims to provide a consistent and reliable way to manage translations in your mods.
No. The library doesn't add anything which would affect performance outside of the initial loading of the translations and language switching.
You need to add it as a dependency in your build.gradle(.kts) file.
repositories {
maven("" rel="noopener nofollow" target="_blank">https://maven.deftu.dev/releases")
}
dependencies {
modImplementation("dev.deftu:textualizer-<MINECRAFT VERSION>-<MOD LOADER>:<VERSION>")
}
Of course, replace <MINECRAFT VERSION> with the version of Minecraft you are developing for, <MOD LOADER> with the mod loader you are developing for, and <VERSION> with the version of the library you want to use.
To create a translated string, you can use
import dev.deftu.textualizer.minecraft.MCLocalization;
String text = MCLocalization.get("com.example");
To create a translated string with arguments, you can use
import dev.deftu.textualizer.MCLocalization;
int number = 10;
String text = MCLocalization.get("com.example", number);
This project is licensed under LGPL-3.0.
© 2024 Deftu