Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
Textualizer

Textualizer

A custom localization implementation for consistency between 1.8.9 - 1.21.

3,833
3
Library
AboutChangelogVersions

Textualizer

A simple localization management library.

Features a Minecraft-specific implementation for mod developers, wrapping around Minecraft's own localization system.


Discord Badge Ko-Fi Badge


For developers

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:<VERSION>")
}

Replace <VERSION> with the version of the library you want to use.

Usage

You'll need to implement Language, LocalizationContext, and Localization in your project. This means you need to handle language metadata, translation loading, translation retrieval, placeholder replacement, and language switching.

Refer to the Minecraft-specific implementation for an example of how to do this.


For Minecraft mod users

Why do I need this?

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.

Is it going to affect my FPS / performance?

No. The library doesn't add anything which would affect performance outside the initial loading of the translations and language switching.


For Minecraft mod developers

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

Getting the current (selected in-game) language's context can be done like so:

import dev.deftu.textualizer.minecraft.MCLocalization;

LocalizationContext context = MCLocalization.current();

To obtain a translated string, you can use

import dev.deftu.textualizer.minecraft.MCLocalization;

LocalizationContext context = MCLocalization.current();
String text = context.get("com.example");

To obtain a translated string and replace your placeholders, you can use

import dev.deftu.textualizer.MCLocalization;

int number = 10;
LocalizationContext context = MCLocalization.current();
String text = context.get("com.example", number);

BisectHosting


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.x
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
Forge
NeoForge

Supported environments

Client-side

Links

Report issues View source Join Discord server
Sponsor on GitHubDonate on PayPalDonate on Ko-fi

Creators

deftu
deftu Member

Details

Licensed LGPL-3.0-or-later
Published 11 months ago
Updated 2 months ago

Modrinth is open source.

main@a0bd011

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.