diff --git a/app/(dashboard)/layout.tsx b/app/(dashboard)/layout.tsx index 4985443..a2d21a3 100644 --- a/app/(dashboard)/layout.tsx +++ b/app/(dashboard)/layout.tsx @@ -46,6 +46,7 @@ export default async function DashboardLayout({ i18n={getClientI18nPayload(resolvedLocale.locale, [ "common", "navigation", + "settings", "status", "validation", ])} diff --git a/scripts/i18n/release-gate.mjs b/scripts/i18n/release-gate.mjs index 2b9c3f7..6c2b7ac 100644 --- a/scripts/i18n/release-gate.mjs +++ b/scripts/i18n/release-gate.mjs @@ -29,12 +29,14 @@ export function runReleaseGate() { } const authLanguageSelectors = scanAuthLanguageSelectors(); + const missingSettingsProviders = scanSettingsNamespaceProviders(); const hardCodedSamples = scanHardCodedUserText(); const failures = { missingInEn, missingInTr, interpolationMismatches, authLanguageSelectors, + missingSettingsProviders, }; const ok = Object.values(failures).every((rows) => rows.length === 0); const summary = { @@ -47,6 +49,7 @@ export function runReleaseGate() { interpolationMismatches: interpolationMismatches.slice(0, 25), }, authLanguageSelectors, + missingSettingsProviders, hardCodedSamples, notes: [ "hardCodedSamples bilgilendirme amaçlıdır; false-positive üretmemesi için gate'i fail ettirmez.", @@ -59,6 +62,24 @@ export function runReleaseGate() { return summary; } +function scanSettingsNamespaceProviders() { + const requiredFiles = [ + { file: path.join(process.cwd(), "app", "(dashboard)", "layout.tsx"), label: "admin dashboard shell" }, + { file: path.join(process.cwd(), "app", "portal", "layout.tsx"), label: "portal shell" }, + ]; + return requiredFiles.flatMap(({ file, label }) => { + if (!fs.existsSync(file)) return [{ file: path.relative(process.cwd(), file), label, reason: "missing file" }]; + const source = fs.readFileSync(file, "utf8"); + if (!source.includes("getClientI18nPayload")) { + return [{ file: path.relative(process.cwd(), file), label, reason: "missing getClientI18nPayload" }]; + } + if (!source.includes('"settings"') && !source.includes("'settings'")) { + return [{ file: path.relative(process.cwd(), file), label, reason: "settings namespace is not included" }]; + } + return []; + }); +} + function collectLocaleKeys(root) { const files = listFiles(root).filter((file) => file.endsWith(".ts")); const entries = new Map();