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:
committed by
GitHub
parent
5833ce955f
commit
3d6ff7c30b
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user