diff --git a/src/main/java/net/raphimc/viaproxy/ui/I18n.java b/src/main/java/net/raphimc/viaproxy/ui/I18n.java index 149fea7..56927b8 100644 --- a/src/main/java/net/raphimc/viaproxy/ui/I18n.java +++ b/src/main/java/net/raphimc/viaproxy/ui/I18n.java @@ -17,9 +17,6 @@ */ package net.raphimc.viaproxy.ui; -import com.google.common.base.Functions; -import com.google.common.collect.ImmutableSortedMap; -import com.google.common.collect.Ordering; import net.raphimc.viabedrock.api.util.FileSystemUtil; import net.raphimc.viaproxy.ViaProxy; @@ -28,6 +25,7 @@ import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.util.*; +import java.util.stream.Collectors; public class I18n { @@ -49,7 +47,9 @@ public class I18n { } catch (Throwable e) { throw new RuntimeException("Failed to load translations", e); } - LOCALES = ImmutableSortedMap.copyOf(LOCALES, Ordering.from(Comparator.comparing((Properties p) -> p.getProperty("language.name"))).onResultOf(Functions.forMap(LOCALES))); + LOCALES = LOCALES.entrySet().stream() + .sorted(Comparator.comparing(e -> e.getValue().getProperty("language.name"))) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> newValue, LinkedHashMap::new)); currentLocale = ViaProxy.getSaveManager().uiSave.get("locale"); if (currentLocale == null || !LOCALES.containsKey(currentLocale)) {