Use method in Locales class for text truncation

This commit is contained in:
William278 committed 2023-03-25 14:24:30 +00:00
1 parent 34fdb88d5c
commit 121d93ab44
4 files changed
+4 -10

No files matched your search

@@ -97,9 +97,8 @@ public class HuskHomesCommand extends Command implements TabProvider {
.filter(command -> user.hasPermission(command.getPermission()))
.map(command -> plugin.getLocales().getRawLocale("command_list_item",
Locales.escapeText(command.getName()),
Locales.escapeText(command.getDescription().length() > 50
? command.getDescription().substring(0, 49).trim() + "…"
: command.getDescription()),
Locales.escapeText(plugin.getLocales()
.truncateText(command.getDescription(), 50)),
Locales.escapeText(plugin.getLocales()
.wrapText(command.getUsage() + "\n" + command.getDescription(), 40)))
.orElse(command.getName()))