aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJakub Zacek <[email protected]>2023-04-20 09:05:41 +0200
committerJakub Zacek <[email protected]>2023-04-20 09:05:41 +0200
commitb4e413f624700e55310cb749b8d9d0483d8326fd (patch)
tree8edb3466d78675775b22ea571f4c22750f0f818e
parent992e145a168b50ccaccd95b57a8dc81d8a4dd0bb (diff)
downloadPaper-b4e413f624700e55310cb749b8d9d0483d8326fd.tar.gz
Paper-b4e413f624700e55310cb749b8d9d0483d8326fd.zip
Fix server ignoring fallback for translatable components (#9134)
-rw-r--r--LICENSE.md1
-rw-r--r--patches/server/Adventure.patch3
2 files changed, 3 insertions, 1 deletions
diff --git a/LICENSE.md b/LICENSE.md
index c3d1668aca..2abc9a2738 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -58,4 +58,5 @@ Jakubk15 <[email protected]>
Luke Chambers <[email protected]>
```
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<Component> args = translatable.args();