fix(i18n): load settings namespace in shells
This commit is contained in:
@@ -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",
|
||||||
])}
|
])}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user