From b74c8f1dd29cf504e6a99f49477d38e45d100458 Mon Sep 17 00:00:00 2001 From: a3510377 Date: Wed, 8 Nov 2023 09:52:19 +0800 Subject: [PATCH] feat lang --- .../carpet_prometheus/utils/CarpetExtraTranslations.java | 2 +- .../resources/assets/carpet_prometheus/lang/zh_cn.json | 9 +++++++++ .../resources/assets/carpet_prometheus/lang/zh_tw.json | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/assets/carpet_prometheus/lang/zh_cn.json create mode 100644 src/main/resources/assets/carpet_prometheus/lang/zh_tw.json diff --git a/src/main/java/com/carpet_prometheus/utils/CarpetExtraTranslations.java b/src/main/java/com/carpet_prometheus/utils/CarpetExtraTranslations.java index edc50ea..6e07bfb 100644 --- a/src/main/java/com/carpet_prometheus/utils/CarpetExtraTranslations.java +++ b/src/main/java/com/carpet_prometheus/utils/CarpetExtraTranslations.java @@ -14,7 +14,7 @@ // from https://github.com/gnembon/carpet-extra/blob/70ac69d9095a1cf0cfbc6f1f8e49fed84d012a90/src/main/java/carpetextra/utils/CarpetExtraTranslations.java public class CarpetExtraTranslations { public static Map getTranslationFromResourcePath(String lang) { - InputStream langFile = CarpetExtraTranslations.class.getClassLoader().getResourceAsStream("assets/info-command/lang/%s.json".formatted(lang)); + InputStream langFile = CarpetExtraTranslations.class.getClassLoader().getResourceAsStream("assets/carpet_prometheus/lang/%s.json".formatted(lang)); if (langFile == null) { // we don't have that language return Collections.emptyMap(); diff --git a/src/main/resources/assets/carpet_prometheus/lang/zh_cn.json b/src/main/resources/assets/carpet_prometheus/lang/zh_cn.json new file mode 100644 index 0000000..649d215 --- /dev/null +++ b/src/main/resources/assets/carpet_prometheus/lang/zh_cn.json @@ -0,0 +1,9 @@ +{ + "category.info-command": "Info Command", + "rule.prometheusEnable.name": "启用 prometheus", + "rule.prometheusEnable.desc": "启用 prometheus", + "rule.prometheusPort.name": "prometheus port", + "rule.prometheusPort.desc": "prometheus 的监听端口", + "rule.prometheusUpdateInterval.name": "prometheus 更新间隔", + "rule.prometheusUpdateInterval.desc": "prometheus 的数据更新间隔" +} \ No newline at end of file diff --git a/src/main/resources/assets/carpet_prometheus/lang/zh_tw.json b/src/main/resources/assets/carpet_prometheus/lang/zh_tw.json new file mode 100644 index 0000000..7897632 --- /dev/null +++ b/src/main/resources/assets/carpet_prometheus/lang/zh_tw.json @@ -0,0 +1,9 @@ +{ + "category.info-command": "Info Command", + "rule.prometheusEnable.name": "啟用 prometheus", + "rule.prometheusEnable.desc": "啟用 prometheus", + "rule.prometheusPort.name": "prometheus port", + "rule.prometheusPort.desc": "prometheus 的監聽端口", + "rule.prometheusUpdateInterval.name": "prometheus 更新間隔", + "rule.prometheusUpdateInterval.desc": "prometheus 的數據更新間隔" +} \ No newline at end of file