mirror of
https://github.com/PaperMC/Velocity.git
synced 2026-02-17 14:37:43 +01:00
fix: TranslatableMapper not using fallback translation (#1716)
This commit is contained in:
@@ -43,6 +43,12 @@ public enum TranslatableMapper implements BiConsumer<TranslatableComponent, Cons
|
||||
final Locale locale = ClosestLocaleMatcher.INSTANCE.lookupClosest(Locale.getDefault());
|
||||
if (GlobalTranslator.translator().canTranslate(translatableComponent.key(), locale)) {
|
||||
componentConsumer.accept(GlobalTranslator.render(translatableComponent, locale));
|
||||
} else {
|
||||
String fallback = translatableComponent.fallback();
|
||||
if (fallback == null) {
|
||||
fallback = translatableComponent.key();
|
||||
}
|
||||
componentConsumer.accept(Component.text(fallback));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user