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.
|
||||
*/
|
||||
const localesCategoriesOverrides: Partial = {
|
||||
const localesCategoriesOverrides: Partial<Record<string, "fun" | "experimental">> = {
|
||||
"en-x-pirate": "fun",
|
||||
"en-x-updown": "fun",
|
||||
"en-x-lolcat": "fun",
|
||||
@ -260,13 +260,7 @@ export default defineNuxtConfig({
|
||||
const omorphiaLocales: string[] = [];
|
||||
const omorphiaLocaleSets = new Map<string, { files: { from: string }[] }>();
|
||||
|
||||
const externalLocales = [
|
||||
"node_modules/@modrinth/ui/src/locales/en-US",
|
||||
"node_modules/@modrinth/moderation/locales/en-US",
|
||||
];
|
||||
|
||||
for (const localePath of externalLocales) {
|
||||
for await (const localeDir of globIterate(localePath, {
|
||||
for await (const localeDir of globIterate("node_modules/@modrinth/ui/src/locales/*", {
|
||||
posix: true,
|
||||
})) {
|
||||
const tag = basename(localeDir);
|
||||
@ -283,7 +277,6 @@ export default defineNuxtConfig({
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return function resolveLocaleImport(tag: string) {
|
||||
return omorphiaLocaleSets.get(matchLocale([tag], omorphiaLocales, "en-x-placeholder"));
|
||||
@ -308,7 +301,7 @@ export default defineNuxtConfig({
|
||||
format: "crowdin",
|
||||
});
|
||||
} else if (fileName === "meta.json") {
|
||||
const meta: Record = await fs
|
||||
const meta: Record<string, { message: string }> = await fs
|
||||
.readFile(localeFile, "utf8")
|
||||
.then((date) => JSON.parse(date));
|
||||
const localeMeta = (locale.meta ??= {});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user