[Update] Plugins: Add localization system.

This commit is contained in:
Sakamoto Shiina
2025-04-26 01:55:28 +09:00
parent 249c686442
commit 819783ea09
10 changed files with 45 additions and 7 deletions

View File

@@ -0,0 +1,14 @@
import en from "./en.yml";
import ja from "./ja.yml";
import plugin_info from "../plugin_info.json";
export const initI18n = (i18n) => {
const ns = plugin_info.plugin_id;
// parse once
const en_res = en;
const ja_res = ja;
// addResourceBundle will merge into i18ns store
i18n.addResourceBundle("en", ns, en_res, /* deep = */ true, /* overwrite = */ true);
i18n.addResourceBundle("ja", ns, ja_res, /* deep = */ true, /* overwrite = */ true);
};