3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 02:50:09 +01:00

Fix server ignoring fallback for translatable components (#9134)

Dieser Commit ist enthalten in:
Jakub Zacek 2023-04-20 09:05:41 +02:00 committet von GitHub
Ursprung beed22d336
Commit f7717c3712
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 5 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -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>
```

Datei anzeigen

@ -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();