Fix runtime default locale resolution
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-15 06:02:27 +01:00
parent 9b8409a7d3
commit c18128c965
29 changed files with 330 additions and 108 deletions
+4 -3
View File
@@ -7,7 +7,7 @@ import { routing } from "@/i18n/routing";
import { getAdminAppPath, toInternalAdminPath } from "@/lib/admin-routing";
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
import { getLocalizedPath } from "@/lib/locale";
import { setMaintenanceMode } from "@/lib/app-config";
import { getSiteSettings, setMaintenanceMode } from "@/lib/app-config";
async function ensureAdmin() {
if (!(await isAdminAuthenticated())) {
@@ -33,10 +33,11 @@ export async function updateMaintenanceModeAction(formData: FormData) {
revalidatePath(toInternalAdminPath("/"));
revalidatePath(toInternalAdminPath("/maintenance"));
revalidatePath(toInternalAdminPath(redirectUrl.pathname));
const siteSettings = await getSiteSettings();
for (const appLocale of routing.locales) {
revalidatePath(getLocalizedPath(appLocale), "layout");
revalidatePath(getLocalizedPath(appLocale, "/coming-soon"));
revalidatePath(getLocalizedPath(appLocale, "/", siteSettings.defaultLocale), "layout");
revalidatePath(getLocalizedPath(appLocale, "/coming-soon", siteSettings.defaultLocale));
}
redirect(`${redirectUrl.pathname}${redirectUrl.search}`);