9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-25 17:49:20 +00:00

Save cause localization support (#214)

This commit is contained in:
Daniil Nartsissov
2023-12-03 16:40:05 +03:00
committed by GitHub
parent 5833ce955f
commit 3d6ff7c30b
16 changed files with 150 additions and 2 deletions

View File

@@ -822,6 +822,11 @@ public class DataSnapshot {
.replaceAll("_", " "), 18);
}
@NotNull
public String getLocale(@NotNull HuskSync plugin) {
return plugin.getLocales().getRawLocale("save_cause_" + name().toLowerCase())
.orElse(getDisplayName());
}
}
/**

View File

@@ -56,7 +56,7 @@ public class DataSnapshotList {
.ofPattern("dd/MM/yyyy, HH:mm")),
snapshot.getTimestamp().format(DateTimeFormatter
.ofPattern("MMM dd yyyy, HH:mm:ss.SSS")),
snapshot.getSaveCause().getDisplayName(),
snapshot.getSaveCause().getLocale(plugin),
String.format("%.2fKiB", snapshot.getFileSize(plugin) / 1024f))
.orElse("" + snapshot.getId())).toList(),
plugin.getLocales().getBaseChatList(6)

View File

@@ -68,7 +68,7 @@ public class DataSnapshotOverview {
locales.getLocale("data_manager_pinned")
.ifPresent(user::sendMessage);
}
locales.getLocale("data_manager_cause", snapshot.getSaveCause().getDisplayName())
locales.getLocale("data_manager_cause", snapshot.getSaveCause().getLocale(plugin))
.ifPresent(user::sendMessage);
locales.getLocale("data_manager_server", snapshot.getServerName())
.ifPresent(user::sendMessage);