From 600c54d89dc3abf564a108c8596a51f6a3f936b3 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Thu, 30 Jul 2020 21:07:59 +0100 Subject: [PATCH] Add translation badge and remove manual remapping of language codes (#1060) --- README.md | 1 + .../org/geysermc/connector/utils/LanguageUtils.java | 12 +----------- connector/src/main/resources/languages | 2 +- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a22a7a8d0..e5d7af58a 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![Build Status](https://ci.nukkitx.com/job/Geyser/job/master/badge/icon)](https://ci.nukkitx.com/job/Geyser/job/master/) [![Discord](https://img.shields.io/discord/613163671870242838.svg?color=%237289da&label=discord)](http://discord.geysermc.org/) [![HitCount](http://hits.dwyl.io/Geyser/GeyserMC.svg)](http://hits.dwyl.io/Geyser/GeyserMC) +[![Crowdin](https://badges.crowdin.net/geyser/localized.svg)](https://translate.geysermc.org/) Geyser is a bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition, closing the gap from those wanting to play true cross-platform. diff --git a/connector/src/main/java/org/geysermc/connector/utils/LanguageUtils.java b/connector/src/main/java/org/geysermc/connector/utils/LanguageUtils.java index 9dabc3871..33ce43e94 100644 --- a/connector/src/main/java/org/geysermc/connector/utils/LanguageUtils.java +++ b/connector/src/main/java/org/geysermc/connector/utils/LanguageUtils.java @@ -135,17 +135,7 @@ public class LanguageUtils { private static String formatLocale(String locale) { try { String[] parts = locale.toLowerCase().split("_"); - String newLocale = parts[0] + "_" + parts[1].toUpperCase(); - switch (newLocale) { // Fallback to the closest language if we don't support it but Bedrock does. - case "es_MX": - return "es_ES"; - case "pt_BR": - return "pt_PT"; - case "fr_CA": - return "fr_FR"; - default: - return newLocale; - } + return parts[0] + "_" + parts[1].toUpperCase(); } catch (Exception e) { return locale; } diff --git a/connector/src/main/resources/languages b/connector/src/main/resources/languages index cd57d6029..65e36478b 160000 --- a/connector/src/main/resources/languages +++ b/connector/src/main/resources/languages @@ -1 +1 @@ -Subproject commit cd57d6029186293b3ca282243a90252db434714b +Subproject commit 65e36478b894af9cec74bc6df6552cb160a0c47d