Files
Pikachu Ren 305d6b0d7d fix(i18n): Crowdin request for init.json (#664)
* fix(build): run i18n.mjs to generate entry.ts when skip-i18n is used

* fix crowdin args

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* ensure langs same

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

* upload i18n.tar.gz to rolling release

Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>

---------

Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
Co-authored-by: PIKACHUIM <PIKACHUIM@users.noreply.github.com>
Co-authored-by: MadDogOwner <xiaoran@xrgzs.top>
Co-authored-by: Copilot <copilot@github.com>
2026-09-06 13:31:31 +08:00

23 lines
644 B
JavaScript

import fs from "fs"
import path from "path"
const root = "./src/lang"
const entry = "entry.ts"
const sourceDir = path.join(root, "en")
const sourceFiles = fs
.readdirSync(sourceDir)
.filter((file) => file.endsWith(".json"))
const langs = fs.readdirSync(root)
langs
.filter((lang) => lang !== "en")
.forEach((lang) => {
const langDir = path.join(root, lang)
sourceFiles.forEach((file) => {
const target = path.join(langDir, file)
if (!fs.existsSync(target)) {
fs.copyFileSync(path.join(sourceDir, file), target)
}
})
fs.copyFileSync(path.join(sourceDir, entry), path.join(langDir, entry))
})