Skip to main content

Internationalisation

The plugin integrates with Docusaurus's built-in i18n system. When building a non-default locale, it looks for translated FAQ files in a locale-specific directory before falling back to the configured path.

Locale directory

For a locale named fr, the plugin checks:

i18n/fr/docusaurus-plugin-faqs/

If that directory exists, it is used instead of the configured path. If it does not exist, the plugin falls back to the configured path (the default-locale files).

Setup

  1. Enable your locale in docusaurus.config.ts:

    i18n: {
    defaultLocale: 'en',
    locales: ['en', 'fr'],
    }
  2. Create the locale directory and add translated YAML files:

    i18n/
    └── fr/
    └── docusaurus-plugin-faqs/
    ├── my-first-faq.yaml
    └── my-second-faq.yaml
  3. Build the French locale:

    docusaurus build --locale fr

The translated FAQ page is served at the locale's URL prefix (e.g. /fr/faqs).

Partial translations

If the locale directory exists but contains fewer files than the default, only those files are shown. No merging with the default-locale files occurs — the locale directory fully replaces the configured path when it exists.