同步插件源代码并补齐标准项目文件
This commit is contained in:
21
utils/i18n.ts
Normal file
21
utils/i18n.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import i18next from "i18next";
|
||||
import { getLanguage } from "obsidian";
|
||||
|
||||
const resources = {
|
||||
en: { translation: require("../locales/en.json") },
|
||||
zh: { translation: require("../locales/zh.json") },
|
||||
};
|
||||
|
||||
i18next.init({
|
||||
lng: getLanguage(),
|
||||
fallbackLng: "en",
|
||||
resources,
|
||||
interpolation: {
|
||||
escapeValue: false,
|
||||
prefix: "{",
|
||||
suffix: "}",
|
||||
},
|
||||
keySeparator: ".",
|
||||
});
|
||||
|
||||
export default i18next;
|
||||
Reference in New Issue
Block a user