Skip to content

Commit

Permalink
feat lang
Browse files Browse the repository at this point in the history
  • Loading branch information
a3510377 committed Nov 8, 2023
1 parent 07e80b1 commit b74c8f1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String> 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();
Expand Down
9 changes: 9 additions & 0 deletions src/main/resources/assets/carpet_prometheus/lang/zh_cn.json
Original file line number Diff line number Diff line change
@@ -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 的数据更新间隔"
}
9 changes: 9 additions & 0 deletions src/main/resources/assets/carpet_prometheus/lang/zh_tw.json
Original file line number Diff line number Diff line change
@@ -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 的數據更新間隔"
}

0 comments on commit b74c8f1

Please sign in to comment.