mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 02:25:28 +01:00
Fix server ignoring fallback for translatable components (#9134)
This commit is contained in:
parent
beed22d336
commit
f7717c3712
@ -58,4 +58,5 @@ Jakubk15 <jakubk15@protonmail.com>
|
||||
Redned <redned235@gmail.com>
|
||||
Luke Chambers <consolelogluke@gmail.com>
|
||||
Emily <emilia.lopezf.1999@gmail.com>
|
||||
dawon <dawon@dawon.eu>
|
||||
```
|
||||
|
@ -736,10 +736,10 @@ index 0000000000000000000000000000000000000000..2fd6c3e65354071af71c7d8ebb97b559
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..ecddb6fe55e8ee1ca3b163503dd62200ce2d7d04
|
||||
index 0000000000000000000000000000000000000000..badde58c5151f838faa4b42db02e767eafa2da18
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
@@ -0,0 +1,354 @@
|
||||
@@ -0,0 +1,355 @@
|
||||
+package io.papermc.paper.adventure;
|
||||
+
|
||||
+import com.mojang.brigadier.exceptions.CommandSyntaxException;
|
||||
@ -799,7 +799,8 @@ index 0000000000000000000000000000000000000000..ecddb6fe55e8ee1ca3b163503dd62200
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ 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();
|
||||
|
Loading…
Reference in New Issue
Block a user