Skip to content

Add text translatable fallback method #981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,16 @@ static MutableComponent translate(String key, Object... objects) {
return Component.translatable(key, objects);
}

@Info("Returns a translatable component of the input key, with args of the objects and a fallback translation in case the client does not have one")
static MutableComponent translateWithFallback(String key, String fallback) {
return Component.translatableWithFallback(key, fallback);
}

@Info("Returns a translatable component of the input key, with args of the objects and a fallback translation in case the client does not have one")
static MutableComponent translateWithFallback(String key, String fallback, Object... objects) {
return Component.translatableWithFallback(key, fallback, objects);
}

@Info("Returns a translatable component of the input key")
static MutableComponent translatable(String key) {
return Component.translatable(key);
Expand All @@ -249,6 +259,16 @@ static MutableComponent translatable(String key, Object... objects) {
return Component.translatable(key, objects);
}

@Info("Returns a translatable component of the input key, with args of the objects and a fallback translation in case the client does not have one")
static MutableComponent translatableWithFallback(String key, String fallback) {
return Component.translatableWithFallback(key, fallback);
}

@Info("Returns a translatable component of the input key, with args of the objects and a fallback translation in case the client does not have one")
static MutableComponent translatableWithFallback(String key, String fallback, Object... objects) {
return Component.translatableWithFallback(key, fallback, objects);
}

@Info("Returns a keybinding component of the input keybinding descriptor")
static MutableComponent keybind(String keybind) {
return Component.keybind(keybind);
Expand Down