Core Concepts

Internationalization

Create multi-language documentation with Docus v4 built-in i18n support.

Docus v4 introduces native internationalization support based on the @nuxtjs/i18n module, allowing you to create documentation in multiple languages with automatic routing and content management.

Features

  • Built-in i18n module: Native integration with @nuxtjs/i18n
  • Dynamic locale routing: Automatic URL prefixing with language codes (/en/docs, /fr/docs)
  • Content collections per locale: Separate content management for each language
  • Language switcher: Built-in component for switching between locales

Setup an existing project

To enable i18n in your Docus project, add the @nuxtjs/i18n module to your nuxt.config.ts and define your locales:

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@nuxtjs/i18n'],
  i18n: {
    defaultLocale: 'en',
    locales: [
      { code: 'en', name: 'English' },
      { code: 'fr', name: 'Français' },
    ],
  }
})
Docus overrides the @nuxtjs/i18n strategy to prefix.

Create a new project with i18n template

When creating a new project, you can choose the i18n template for pre-configured internationalization:

Terminal
npx create-docus my-docs -t i18n

Directory Structure

When i18n is enabled, organize your content by locale in the content/ directory:

content/
├── en/                    # English content
   ├── index.md          # English homepage
   ├── getting-started/
   ├── installation.md
   └── configuration.md
   └── guide/
       └── advanced.md
├── fr/                    # French content
   ├── index.md          # French homepage
   ├── getting-started/
   ├── installation.md
   └── configuration.md
   └── guide/
       └── advanced.md
Each locale should mirror the same directory structure to maintain consistent navigation across languages.

Locale fallback

Docus warns and skips any locale that does not exist in your content/ directory. Missing locales are not registered.

This is especially helpful when you extend Docus and use @nuxtjs/i18n for the rest of your site, but only want the docs in a subset of languages.

Docus detects locales from your nuxt config:

nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@nuxtjs/i18n'],
  i18n: {
    locales: ['en', 'fr', 'ja'],
    defaultLocale: 'en'
  }
})

But only register it based on your content/ folder structure:

content/
├─ en/           # registered ✅
├─ fr/           # registered ✅ (if present)
└─ ja/           # skipped 🚫 (if missing)

If a user requests a missing docs locale, Docus redirects to the default locale.

You must set a defaultLocale in your i18n config and ensure it exists under content/<defaultLocale>