mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-21 16:09:21 +00:00
added supported languages
This commit is contained in:
@@ -23,6 +23,7 @@ import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.translation.Translator;
|
||||
import net.momirealms.customcrops.common.helper.AdventureHelper;
|
||||
import net.momirealms.customcrops.common.plugin.CustomCropsPlugin;
|
||||
import net.momirealms.customcrops.common.plugin.CustomCropsProperties;
|
||||
import net.momirealms.customcrops.common.util.Pair;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -38,7 +39,6 @@ import java.util.stream.Stream;
|
||||
public class TranslationManager {
|
||||
|
||||
public static final Locale DEFAULT_LOCALE = Locale.ENGLISH;
|
||||
private static final List<String> locales = List.of("en", "zh_cn");
|
||||
private static TranslationManager instance;
|
||||
private static Locale FORCE_LOCALE = null;
|
||||
|
||||
@@ -63,7 +63,9 @@ public class TranslationManager {
|
||||
MiniMessageTranslator.translator().removeSource(this.registry);
|
||||
this.installed.clear();
|
||||
}
|
||||
for (String lang : locales) {
|
||||
|
||||
String supportedLocales = CustomCropsProperties.getValue("lang");
|
||||
for (String lang : supportedLocales.split(",")) {
|
||||
this.plugin.getConfigManager().saveResource("translations/" + lang + ".yml");
|
||||
}
|
||||
|
||||
|
||||
@@ -18,3 +18,4 @@ caffeine=${caffeine_version}
|
||||
exp4j=${exp4j_version}
|
||||
slf4j=${slf4j_version}
|
||||
zstd-jni=${zstd_version}
|
||||
lang=${lang}
|
||||
@@ -1,4 +1,4 @@
|
||||
# Don"t change this
|
||||
# Don't change this
|
||||
config-version: "41"
|
||||
|
||||
season.spring: "Spring"
|
||||
@@ -4,6 +4,9 @@ project_version=3.6.16
|
||||
config_version=41
|
||||
project_group=net.momirealms
|
||||
|
||||
# Supported languages
|
||||
lang=en,zh_cn
|
||||
|
||||
# Dependency settings
|
||||
paper_version=1.20.4
|
||||
jetbrains_annotations_version=24.0.0
|
||||
|
||||
Reference in New Issue
Block a user