mirror of
https://github.com/coaidev/coai.git
synced 2025-06-06 05:40:25 +09:00
21 lines
483 B
TypeScript
21 lines
483 B
TypeScript
import { Plugin } from "vite";
|
|
import path from "path";
|
|
import * as fs from "fs";
|
|
|
|
export function createTranslationPlugin(): Plugin {
|
|
return {
|
|
name: "translate-plugin",
|
|
apply: "build",
|
|
configResolved(config) {
|
|
try {
|
|
const source = path.resolve(config.root, "src/resources/i18n");
|
|
|
|
const files = fs.readdirSync(source);
|
|
console.log(files);
|
|
} catch (e) {
|
|
console.debug(`error during translation: ${e}`);
|
|
}
|
|
},
|
|
};
|
|
}
|