Add chinese translation

Based on https://github.com/dyxang/Fantasy-Map-Generator-Chinese
This commit is contained in:
Blipz 2026-03-28 04:59:26 +01:00
parent 7eeb1f76c3
commit c5f1577c4b
12 changed files with 3359 additions and 980 deletions

View file

@ -8,7 +8,7 @@ const HTMLPlugin: Plugin = {
const content = await readFile("src/index.html", "utf-8");
const matches = content.matchAll(/data-(?:html|text|tip)="([^"]+)"/g);
for (const match of matches) {
const key = match[1];
const key = match[1].replace(/"/g, '"');
keys.set(key, {key, defaultValue: key});
}
}
@ -17,13 +17,15 @@ const HTMLPlugin: Plugin = {
export default defineConfig({
locales: [
"en",
"fr"
"fr",
"zh"
],
extract: {
input: "src/**/*.{js,ts}",
output: "public/locales/{{language}}/{{namespace}}.json",
defaultNS: "lang",
keySeparator: false
keySeparator: "::",
nsSeparator: false,
},
plugins: [
HTMLPlugin