mirror of
https://github.com/OpenListTeam/OpenList-Frontend.git
synced 2026-10-05 17:18:41 +00:00
305d6b0d7d
* 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>
23 lines
644 B
JavaScript
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))
|
|
})
|