Skip to content

docs: keep site English-only#2

Merged
BunsDev merged 1 commit into
mainfrom
docs/english-only
May 24, 2026
Merged

docs: keep site English-only#2
BunsDev merged 1 commit into
mainfrom
docs/english-only

Conversation

@BunsDev
Copy link
Copy Markdown
Member

@BunsDev BunsDev commented May 24, 2026

Summary

  • remove the docs search dialog dependency on Fumadocs locale context
  • add an English-only guard that blocks non-English locale directories and locale-aware search plumbing
  • run the English-only guard as part of production builds

Verification

  • npm run check:english-only (red before implementation, green after)
  • npm run check:fumadocs
  • npm run check:mermaid
  • npm run check:links
  • npm run build
  • git diff --check

Co-authored-by: Nova nova@opencoven.ai

Co-authored-by: Nova <nova@opencoven.ai>
Copilot AI review requested due to automatic review settings May 24, 2026 09:41
@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
coven-docs Ready Ready Preview May 24, 2026 9:41am

@BunsDev BunsDev merged commit 272a5b3 into main May 24, 2026
2 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enforces an English-only configuration for the Coven docs site by removing locale-coupled search wiring and adding a build-time guard script to prevent reintroducing i18n structure/search settings.

Changes:

  • Added scripts/check-english-only.mjs to detect non-English locale directories and locale-aware search/language plumbing.
  • Updated build to run the English-only guard before next build.
  • Removed Fumadocs locale context usage from the docs search dialog.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
scripts/check-english-only.mjs New build-time guard script intended to prevent locale directories and locale-aware search configuration.
package.json Runs the English-only guard as part of production builds and adds a dedicated script entry.
components/search-dialog.tsx Removes dependency on Fumadocs useI18n() and stops passing locale into useDocsSearch.

Comment on lines +5 to +43
const forbiddenLocaleDirs = new Set([
'ar',
'de',
'es',
'fr',
'it',
'ja',
'ko',
'pt',
'ru',
'zh',
'zh-CN',
'zh-TW',
]);
const ignoredDirs = new Set(['.git', '.next', '.source', 'node_modules']);

function walk(dir) {
const entries = fs.readdirSync(dir, { withFileTypes: true });
const matches = [];

for (const entry of entries) {
if (!entry.isDirectory()) continue;
if (ignoredDirs.has(entry.name)) continue;

const entryPath = path.join(dir, entry.name);
const relative = path.relative(root, entryPath).replace(/\\/g, '/');

if (forbiddenLocaleDirs.has(entry.name)) {
matches.push(relative);
continue;
}

matches.push(...walk(entryPath));
}

return matches;
}

const localeDirectories = walk(root);
}

const searchDialog = fs.readFileSync(path.join(root, 'components/search-dialog.tsx'), 'utf8');
if (searchDialog.includes('useI18n') || searchDialog.includes('locale,')) {
@BunsDev BunsDev deleted the docs/english-only branch May 24, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants