refactor: polish jp translation
This commit is contained in:
@@ -56,7 +56,8 @@
|
||||
"title": "Language",
|
||||
"desc": "Setting the language",
|
||||
"en": "English",
|
||||
"zh": "中文"
|
||||
"zh": "中文",
|
||||
"jp": "Japanese"
|
||||
}
|
||||
},
|
||||
"license": {
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
"desc": "言語の設定",
|
||||
"en": "英語",
|
||||
"zh": "中国語",
|
||||
"ja": "日本語"
|
||||
"jp": "日本語"
|
||||
}
|
||||
},
|
||||
"license": {
|
||||
|
||||
@@ -57,7 +57,8 @@
|
||||
"title": "语言",
|
||||
"desc": "设置界面语言",
|
||||
"en": "英文",
|
||||
"zh": "中文"
|
||||
"zh": "中文",
|
||||
"jp": "日文"
|
||||
}
|
||||
},
|
||||
"license": {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import dayjs from "dayjs";
|
||||
import "dayjs/locale/zh-cn";
|
||||
import "dayjs/locale/ja";
|
||||
import relativeTime from "dayjs/plugin/relativeTime";
|
||||
import isToday from "dayjs/plugin/isToday";
|
||||
import isYesterday from "dayjs/plugin/isYesterday";
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ export const resources = {
|
||||
} as const;
|
||||
i18n.on("languageChanged", (lng) => {
|
||||
console.log("changed", lng);
|
||||
dayjs.locale(lng === 'zh' ? "zh-cn" : lng);
|
||||
dayjs.locale(lng === 'zh' ? "zh-cn" : lng === 'jp' ? "ja" : lng);
|
||||
});
|
||||
i18n
|
||||
// load translation using http -> see /public/locales (i.e. https://github.com/i18next/react-i18next/tree/master/example/react/public/locales)
|
||||
@@ -50,7 +50,7 @@ i18n
|
||||
ns: ["common", "chat", "member", "setting", "fav", "file", "welcome", "auth"],
|
||||
defaultNS,
|
||||
load: "languageOnly",
|
||||
// lng: "zh",
|
||||
// lng: "jp",
|
||||
fallbackLng: 'en',
|
||||
fallbackNS: "common",
|
||||
debug: false,
|
||||
|
||||
@@ -18,8 +18,8 @@ const Index = () => {
|
||||
</span>
|
||||
</p>
|
||||
<StyledRadio
|
||||
options={[t("overview.lang.en"), t("overview.lang.zh")]}
|
||||
values={["en", "zh"]}
|
||||
options={[t("overview.lang.en"), t("overview.lang.zh"), t("overview.lang.jp")]}
|
||||
values={["en", "zh", "jp"]}
|
||||
value={i18n.language.split("-")[0]}
|
||||
onChange={(v) => {
|
||||
console.log("wtff", v);
|
||||
|
||||
Reference in New Issue
Block a user