Skip to content

Add i18n support with next-intl for 17 locales#36

Open
Copilot wants to merge 4 commits intomasterfrom
copilot/add-i18n-support-fumadocs
Open

Add i18n support with next-intl for 17 locales#36
Copilot wants to merge 4 commits intomasterfrom
copilot/add-i18n-support-fumadocs

Conversation

Copy link
Contributor

Copilot AI commented Feb 1, 2026

Implements internationalization to enable reuse of existing Crowdin project translations from the v2 Docusaurus site.

Content Structure

Migrated flat content structure to locale-scoped directories:

content/docs/* → content/docs/{locale}/*
content/blog/* → content/blog/{locale}/*

Currently populated: en/ (source locale). Other 16 locale directories created empty, ready for Crowdin translations.

Routing

  • App routes wrapped in [locale] dynamic segment
  • Middleware handles locale detection and redirects
  • URLs: /en/docs/get-started, /zh/docs/get-started, etc.
  • API routes excluded from localization

Fumadocs Integration

Custom locale-aware loaders in src/lib/source.ts:

function createLocalizedSource(locale: string) {
  return loader({
    baseUrl: `/${locale}/docs`,
    source: {
      ...docs.toFumadocsSource(),
      files: docs.toFumadocsSource().files.filter(f => 
        f.path.includes(`docs/${locale}/`)
      ),
    },
    // ...
  });
}

Slug generation strips locale folder to maintain flat URLs.

Configuration

  • next-intl: 17 locales (en, zh, ja, ko, fr, de, es, ru, ar, pt, it, tr, id, th, ms, uk, vi)
  • Message files: messages/{locale}.json for UI strings (en, zh translated; others placeholders)
  • Middleware: src/middleware.ts with matcher excluding static assets
  • Config: i18n.ts, src/i18n/routing.ts

Crowdin Ready

Content structure mirrors v2 for direct translation import. English content serves as source.

See docs/I18N_SETUP.md for locale addition workflow.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/casbin-website-v3/casbin-website-v3/node_modules/.bin/next build sh -c del/super-admin.mdx" (dns block)
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/casbin-website-v3/casbin-website-v3/node_modules/.bin/next build sh px ntent/docs/en/model/rbac/rbac-with-pattern.mdx" -last-updated.ts ndor/bin/sh rd copilot/add-i18n-c nfig/composer/venpx tsx scripts/generate-last-updated.ts /bin/sh d/po�� mat=%cd --date=iso-strict -- "content/docs/en/model/effector.mdx" git node_modules/@npmcli/run-script/lib/node-gyp-bin/node get (dns block)
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/casbin-website-v3/casbin-website-v3/node_modules/.bin/next build /bin/sh es/.�� git log -1 --format=%cd --date=iso-strict -- "content/docs/en/inINVALID,NEW sh es/.bin/sh node scripts/buish dated bin/node sh -c d.ts bash /usr/local/sbin/sh --noprofile (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[feature] support i18n for this fumadocs site</issue_title>
<issue_description>the v2 old site (https://github.com/casbin/casbin-website-v3) uses docusaurus and already has a Crowdin project: https://crowdin.com/project/casbin

now for this fumadocs v3 site (https://github.com/casbin/casbin-website-v3), better to use the same Crowdin project (and existing transations) to enable i18n in this v3 site</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify
Copy link

netlify bot commented Feb 1, 2026

Deploy Preview for casbin-website-v3 failed.

Name Link
🔨 Latest commit 8ddd741
🔍 Latest deploy log https://app.netlify.com/projects/casbin-website-v3/deploys/697f02838c20a600085389e6

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
Co-authored-by: nomeguy <85475922+nomeguy@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for i18n in Fumadocs site Add i18n support with next-intl for 17 locales Feb 1, 2026
Copilot AI requested a review from nomeguy February 1, 2026 07:40
@hsluoyz hsluoyz force-pushed the master branch 3 times, most recently from 7b20304 to 70d3373 Compare February 1, 2026 12:32
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.

[feature] support i18n for this fumadocs site

3 participants