Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions src/components/internationalization/middleware.ts

This file was deleted.

27 changes: 12 additions & 15 deletions validate-i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ const checks = [
path: 'src/components/internationalization/config.ts',
required: true
},
{
name: 'V2.0 Middleware',
path: 'src/components/internationalization/middleware.ts',
required: true
},
{
name: 'V2.0 Dictionaries',
path: 'src/components/internationalization/dictionaries.ts',
Expand All @@ -44,8 +39,8 @@ const checks = [
required: true
},
{
name: 'Root Middleware',
path: 'middleware.ts',
name: 'Root Proxy (Next 16)',
path: 'proxy.ts',
required: true
},
{
Expand Down Expand Up @@ -87,16 +82,18 @@ try {
allPassed = false;
}

// Check middleware content
// Check proxy content (Next 16 replaces middleware.ts)
try {
const middlewarePath = path.join(process.cwd(), 'middleware.ts');
const middlewareContent = fs.readFileSync(middlewarePath, 'utf8');

const usesNewStructure = middlewareContent.includes('./src/components/internationalization/middleware');
console.log(`${usesNewStructure ? '✅' : '❌'} Root middleware uses new structure`);

const proxyPath = path.join(process.cwd(), 'proxy.ts');
const proxyContent = fs.readFileSync(proxyPath, 'utf8');

const importsConfig = proxyContent.includes("./src/components/internationalization/config");
const exportsProxy = /export\s+function\s+proxy\b/.test(proxyContent);
console.log(`${importsConfig ? '✅' : '❌'} proxy.ts imports from internationalization/config`);
console.log(`${exportsProxy ? '✅' : '❌'} proxy.ts exports a named proxy() function`);

} catch (error) {
console.log('❌ Could not validate middleware content');
console.log('❌ Could not validate proxy content');
allPassed = false;
}

Expand Down