fix: locale issues
This commit is contained in:
parent
fe3d360215
commit
b87fb1de00
@ -34,7 +34,7 @@ const enabledLocales: string[] = [];
|
|||||||
/**
|
/**
|
||||||
* Overrides for the categories of the certain locales.
|
* Overrides for the categories of the certain locales.
|
||||||
*/
|
*/
|
||||||
const localesCategoriesOverrides: Partial = {
|
const localesCategoriesOverrides: Partial<Record<string, "fun" | "experimental">> = {
|
||||||
"en-x-pirate": "fun",
|
"en-x-pirate": "fun",
|
||||||
"en-x-updown": "fun",
|
"en-x-updown": "fun",
|
||||||
"en-x-lolcat": "fun",
|
"en-x-lolcat": "fun",
|
||||||
@ -260,28 +260,21 @@ export default defineNuxtConfig({
|
|||||||
const omorphiaLocales: string[] = [];
|
const omorphiaLocales: string[] = [];
|
||||||
const omorphiaLocaleSets = new Map<string, { files: { from: string }[] }>();
|
const omorphiaLocaleSets = new Map<string, { files: { from: string }[] }>();
|
||||||
|
|
||||||
const externalLocales = [
|
for await (const localeDir of globIterate("node_modules/@modrinth/ui/src/locales/*", {
|
||||||
"node_modules/@modrinth/ui/src/locales/en-US",
|
posix: true,
|
||||||
"node_modules/@modrinth/moderation/locales/en-US",
|
})) {
|
||||||
];
|
const tag = basename(localeDir);
|
||||||
|
omorphiaLocales.push(tag);
|
||||||
|
|
||||||
for (const localePath of externalLocales) {
|
const localeFiles: { from: string; format?: string }[] = [];
|
||||||
for await (const localeDir of globIterate(localePath, {
|
|
||||||
posix: true,
|
|
||||||
})) {
|
|
||||||
const tag = basename(localeDir);
|
|
||||||
omorphiaLocales.push(tag);
|
|
||||||
|
|
||||||
const localeFiles: { from: string; format?: string }[] = [];
|
omorphiaLocaleSets.set(tag, { files: localeFiles });
|
||||||
|
|
||||||
omorphiaLocaleSets.set(tag, { files: localeFiles });
|
for await (const localeFile of globIterate(`${localeDir}/*`, { posix: true })) {
|
||||||
|
localeFiles.push({
|
||||||
for await (const localeFile of globIterate(`${localeDir}/*`, { posix: true })) {
|
from: pathToFileURL(localeFile).toString(),
|
||||||
localeFiles.push({
|
format: "default",
|
||||||
from: pathToFileURL(localeFile).toString(),
|
});
|
||||||
format: "default",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,7 +301,7 @@ export default defineNuxtConfig({
|
|||||||
format: "crowdin",
|
format: "crowdin",
|
||||||
});
|
});
|
||||||
} else if (fileName === "meta.json") {
|
} else if (fileName === "meta.json") {
|
||||||
const meta: Record = await fs
|
const meta: Record<string, { message: string }> = await fs
|
||||||
.readFile(localeFile, "utf8")
|
.readFile(localeFile, "utf8")
|
||||||
.then((date) => JSON.parse(date));
|
.then((date) => JSON.parse(date));
|
||||||
const localeMeta = (locale.meta ??= {});
|
const localeMeta = (locale.meta ??= {});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user