+7
-4
@@ -1,7 +1,10 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
module.exports = function () {
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
export default function () {
|
||||
const localesDir = path.join(__dirname, "..", "locales");
|
||||
const dict = {};
|
||||
for (const file of fs.readdirSync(localesDir)) {
|
||||
@@ -10,4 +13,4 @@ module.exports = function () {
|
||||
dict[locale] = JSON.parse(fs.readFileSync(path.join(localesDir, file), "utf8"));
|
||||
}
|
||||
return dict;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user