From 39e94c6ea79d16c78fc23c04700c8595a241085d Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Wed, 29 May 2024 23:04:58 +0800 Subject: [PATCH] [ci skip] Try to decrease complexity --- src/main/java/fr/xephi/authme/util/message/I18NUtils.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/fr/xephi/authme/util/message/I18NUtils.java b/src/main/java/fr/xephi/authme/util/message/I18NUtils.java index f7be5981..77ac4d7c 100644 --- a/src/main/java/fr/xephi/authme/util/message/I18NUtils.java +++ b/src/main/java/fr/xephi/authme/util/message/I18NUtils.java @@ -91,11 +91,15 @@ public class I18NUtils { // return "zhmc"; } + // Match locale code with "_" + return matchLocale(locale, settings); + } + + private static String matchLocale(String locale, Settings settings) { if (locale.contains("_")) { locale = locale.substring(0, locale.indexOf("_")); } - // Match locale code with "_" if (LOCALE_LIST.contains(locale)) { return locale; }