Author Validation Improvements (#3970)

* feat: set up typed nag (validators) system

* feat: start on frontend impl

* fix: shouldShow issues

* feat: continue work

* feat: re add submitting/re-submit nags

* feat: start work implementing validation checks using new nag system

* fix: links page + add more validations

* feat: tags validations

* fix: lint issues

* fix: lint

* fix: issues

* feat: start on i18nifying nags

* feat: impl intl

* fix: minecraft title clause update

---------

Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
IMB11
2025-07-16 23:28:42 +01:00
committed by GitHub
parent 90043fe84d
commit 44267619b6
23 changed files with 2212 additions and 660 deletions

View File

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