Textualizer
An extension upon Textile which has it’s own custom I18n implementation.
Setup
You need to add it as a dependency in your build.gradle(.kts)
file.
repositories {
maven("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.
Usage
To create a translated string, you can use
import dev.deftu.textualizer.LanguageManager;
String text = LanguageManager.translate("com.example");
To create a translated string with arguments, you can use
import dev.deftu.textualizer.LanguageManager;
int number = 10;
String text = LanguageManager.translate("com.example", number);
Interopability with Textile
Textualizer provides implementations of TextHolder
and MutableTextHolder
(or, more specifically, SimpleTextHolder
and SimpleMutableTextHolder
)
import dev.deftu.textile.TextHolder;
import dev.deftu.textile.MutableTextHolder;
import dev.deftu.textualizer.text.TextualizerTextHolder;
import dev.deftu.textualizer.text.TextualizerMutableTextHolder;
TextHolder text = new TextualizerTextHolder("com.example");
MutableTextHolder mutableText = new TextualizerMutableTextHolder("com.example");
This project is licensed under LGPL-3.0.
© 2024 Deftu
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Compatibility
Minecraft: Java Edition
1.21
1.20.6
1.20.4
1.20.1–1.20.2
1.19.4
1.19.2
1.18.2
1.17.1
1.16.5
1.12.2
1.8.9
Platforms
Fabric
Supported environments
Links
Creators
Details
Licensed LGPL-3.0-or-later
Published 4 months ago
Updated 3 months ago