fix(i18n): load settings namespace in shells

This commit is contained in:
poyrazavsever
2026-07-21 15:10:52 +03:00
parent c40c025d05
commit bcf6091247
2 changed files with 22 additions and 0 deletions
+1
View File
@@ -46,6 +46,7 @@ export default async function DashboardLayout({
i18n={getClientI18nPayload(resolvedLocale.locale, [ i18n={getClientI18nPayload(resolvedLocale.locale, [
"common", "common",
"navigation", "navigation",
"settings",
"status", "status",
"validation", "validation",
])} ])}
+21
View File
@@ -29,12 +29,14 @@ export function runReleaseGate() {
} }
const authLanguageSelectors = scanAuthLanguageSelectors(); const authLanguageSelectors = scanAuthLanguageSelectors();
const missingSettingsProviders = scanSettingsNamespaceProviders();
const hardCodedSamples = scanHardCodedUserText(); const hardCodedSamples = scanHardCodedUserText();
const failures = { const failures = {
missingInEn, missingInEn,
missingInTr, missingInTr,
interpolationMismatches, interpolationMismatches,
authLanguageSelectors, authLanguageSelectors,
missingSettingsProviders,
}; };
const ok = Object.values(failures).every((rows) => rows.length === 0); const ok = Object.values(failures).every((rows) => rows.length === 0);
const summary = { const summary = {
@@ -47,6 +49,7 @@ export function runReleaseGate() {
interpolationMismatches: interpolationMismatches.slice(0, 25), interpolationMismatches: interpolationMismatches.slice(0, 25),
}, },
authLanguageSelectors, authLanguageSelectors,
missingSettingsProviders,
hardCodedSamples, hardCodedSamples,
notes: [ notes: [
"hardCodedSamples bilgilendirme amaçlıdır; false-positive üretmemesi için gate'i fail ettirmez.", "hardCodedSamples bilgilendirme amaçlıdır; false-positive üretmemesi için gate'i fail ettirmez.",
@@ -59,6 +62,24 @@ export function runReleaseGate() {
return summary; 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) { function collectLocaleKeys(root) {
const files = listFiles(root).filter((file) => file.endsWith(".ts")); const files = listFiles(root).filter((file) => file.endsWith(".ts"));
const entries = new Map(); const entries = new Map();