From b4e413f624700e55310cb749b8d9d0483d8326fd Mon Sep 17 00:00:00 2001 From: Jakub Zacek Date: Thu, 20 Apr 2023 09:05:41 +0200 Subject: [PATCH] Fix server ignoring fallback for translatable components (#9134) --- LICENSE.md | 1 + patches/server/Adventure.patch | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index c3d1668aca..2abc9a2738 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -58,4 +58,5 @@ Jakubk15 Redned Luke Chambers Emily +dawon ``` diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 3dc774c38a..b756a6f644 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -799,7 +799,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + } + } -+ final @NotNull String translated = Language.getInstance().getOrDefault(translatable.key()); ++ final @Nullable String fallback = translatable.fallback(); ++ final @NotNull String translated = Language.getInstance().getOrDefault(translatable.key(), fallback != null ? fallback : translatable.key()); + + final Matcher matcher = LOCALIZATION_PATTERN.matcher(translated); + final List args = translatable.args();