[Update] Localization: json to yaml.

This commit is contained in:
Sakamoto Shiina
2024-12-09 16:51:36 +09:00
parent 057e2ced63
commit 5ad4207f29
14 changed files with 1307 additions and 1354 deletions

View File

@@ -1,11 +1,18 @@
import yaml from "js-yaml";
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import translation_en from "./en.json";
import translation_ja from "./ja.json";
import translation_ko from "./ko.json";
import translation_zh_Hant from "./zh-Hant.json";
import translation_zh_Hans from "./zh-Hans.json";
import en_yml from "./en.yml?raw";
import ja_yml from "./ja.yml?raw";
import ko_yml from "./ko.yml?raw";
import zh_hant_yml from "./zh-Hant.yml?raw";
import zh_hans_yml from "./zh-Hans.yml?raw";
const translation_en = yaml.load(en_yml);
const translation_ja = yaml.load(ja_yml);
const translation_ko = yaml.load(ko_yml);
const translation_zh_Hant = yaml.load(zh_hant_yml);
const translation_zh_Hans = yaml.load(zh_hans_yml);
const resources = {
@@ -24,9 +31,8 @@ i18n
fallbackLng: "en",
debug: true,
interpolation: {
escapeValue: false // react already safes from xss
},
// react: { useSuspense: false },
});
escapeValue: false, // react already safes from xss
},
});
export default i18n;