Anydocs Documents
Core Concepts

Multilingual Support

Understand how multilingual docs are configured and maintained.

Anydocs supports multilingual documentation natively. The important part is not only declaring `languages`, but also making sure every enabled language has both its page directory and navigation file, while reusing the same `pageId` across translations whenever possible.

Basic Configuration

{
  "defaultLanguage": "zh",
  "languages": ["zh", "en"]
}

Required Structure

Each enabled language needs its own page directory and navigation file.

  • `pages/<lang>/`: page files for that language
  • `navigation/<lang>.json`: navigation tree for that language
  • `defaultLanguage`: controls which language the root entry falls back to

Maintenance Guidance

When the same document exists in multiple languages, it is best to keep the same `pageId` across translations so the language switcher can resolve the counterpart more reliably. Slugs can vary by language, but navigation references and page files still need to stay in sync.