1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-29 19:59:13 +00:00

Add translation badge and remove manual remapping of language codes (#1060)

This commit is contained in:
rtm516
2020-07-30 21:07:59 +01:00
committed by GitHub
parent 118747c66b
commit 600c54d89d
3 changed files with 3 additions and 12 deletions

View File

@@ -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.

View File

@@ -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;
}