Internationalization
Write source content under pages/ and put translations at the same path under translations/<lang>/; translate navigation labels with labels.yml. Write translations by hand or translate incrementally with AI.
This site's default language is Simplified Chinese, with an English version as well. Click the language switcher in the header, or prefix the URL with /en, to see the English translation of the same page.
Configure languages
languages:
- lang: zh
default: true
display-name: 简体中文
- lang: en
display-name: English- The language marked
default: true(or the first entry if none is marked) is the default language: its URLs have no prefix and it is used for the home page. - The source language is the language that files under
pages/and the text indocs.ymlare written in. It is usually the default language; when they differ, mark it withsource: true, see Default language other than the source. - Other languages get a
/<lang>prefix:/guides/get-started/quickstart→/en/guides/get-started/quickstart. display-nameis the name shown in the language switcher; a built-in name is used when omitted.- UI text (search, copy, previous / next, feedback, table of contents, and so on) is built in for many languages, including Simplified Chinese, Traditional Chinese, English, Japanese, Korean, Spanish, French, German, Portuguese, Russian, and Italian, and switches automatically with the page language.
- Arabic, Hebrew, Persian, and similar languages automatically use right-to-left layout (
<html dir="rtl">).
translations: is equivalent to languages:; either works.
Default language other than the source
If the originals are written in Chinese but visitors should see English by default, make English the default and mark Chinese as the source with source: true:
languages:
- lang: zh
source: true
display-name: 简体中文
- lang: en
default: true
display-name: EnglishNo files move: originals stay in pages/, English translations stay in translations/en/, and labels.yml is still keyed by the original text. Only the URLs change:
| Page | Before | After |
|---|---|---|
| English | /en/guides/quickstart | /guides/quickstart |
| Chinese | /guides/quickstart | /zh/guides/quickstart |
- The platform redirects old
/en/…links to the URL without a prefix. - Links without a prefix, which used to open Chinese, now open the English page.
- Content without a translation shows the original in the default language; other languages show the default language first. See Missing translations. Fill in the default language before switching.
Directory convention
my-docs
pages
guides
translations
en
pages
guides
A translation is a complete MDX file (including frontmatter). The page's title, description, and so on come from the translation's frontmatter.
Missing translations
When a page has no translation, the page still exists in that language and shows, in order:
- the translation in that language;
- the translation in the default language (when it differs from the source language);
- the original.
For example, on a site written in Chinese whose default language is English, pages without a Japanese translation show English, and Chinese only if there is no English either. Pages, API overview pages, and changelog entries fall back as whole files; OpenAPI text, labels in labels.yml, and external links fall back one by one. The source language always shows the original.
A page's name in the navigation is, in order: sidebar-title in the translation's frontmatter, the translation in that language's labels.yml (or overlay file), the title of that language's translation, and only then the navigation title in the default language or the original. This keeps the navigation structure consistent across languages with no dead links, and links between pages stay in the current language.
Links and images
- Relative links between pages (
./quickstart.mdx) are written as usual in translations; the builder mapstranslations/en/…back to the source path and then resolves it to the English page's URL. - Use project-root paths starting with
/for images (/assets/diagram.svg) so translations and sources share the same assets. - Site URLs starting with
/stay in the current language (and version). Besides pages, that covers the home page/,llms.txt,llms-full.txt, changelog feeds (/changelog.rssand so on), the.mdversion of pages, and short addresses fromredirects;?queryand#anchorare kept. - When the target doesn't exist in the current language and version, the default version in the current language is used, then the URL as written. Files that exist once, such as
sitemap.xml, aren't affected. - To link to a specific language or version, write its code or URL segment; the default language and version work too:
/zh/guides/x,/v1/guides/x.
labels.yml: translate navigation and site texts
Navigation titles and texts such as the header and footer are written in docs.yml (or version files) in the source language. translations/<lang>/labels.yml is a "source → translation" mapping that covers:
Navigation
- Tab
display-names - Section, page, and link titles
foldertitles and auto-generated page titlesapisection andchangelogtitles- Version and product
display-names, and productsubtitles - Section and page
tags(each item on its own, including those in the original frontmatter)
Site texts
- The site name
title,description,seo.title-template, and the text next to the logologo.right-text - The announcement
announcement.message, and thetextof header links and buttons - The footer's
text, column titles, link texts, and badges (except a custom footer,footer.file) - The Ask AI greeting
ai.greeting, suggested questionsai.suggestions, and noticeai.disclaimer - The
llms.txtdescriptionagents.llms-txt.description
指南: Guides
组件: Components
API 参考: API Reference
更新日志: Changelog
开始: Get started
简介: Introduction
快速开始: QuickstartTexts not listed in labels.yml fall back in the order of Missing translations. When you switch to a language in the editor, Docs settings shows how many site texts in each category still have no translation.
Localized external links
External addresses in docs.yml (http(s)://, mailto: and so on) can be swapped per language too: add the original address as the key and that language's address as the value in labels.yml. This works for the logo link, header links and buttons, the announcement link, tabs that link elsewhere, and footer links, badges and social icons.
https://acme.com/zh: https://acme.com/en
https://acme.com/zh/signup: https://acme.com/en/signup
https://x.com/acme_zh: https://x.com/acmeAddresses you don't list keep the original. Links within the site that start with / don't need entries: they go to the matching language's page automatically. In the editor, switch to that language and the address fields of external links under Docs settings let you enter this language's address directly; leave one empty to keep the original.
Per-language navigation files
A configuration file can be mirrored under translations/<lang>/ at the same path, carrying only what changes in that language: docs.yml maps to translations/<lang>/docs.yml, and a version or product navigation file (such as versions/v2.yml) to translations/<lang>/versions/v2.yml. These win over labels.yml.
tabs:
guide:
display-name: Guides
navigation:
- tab: guide
layout:
- section: Get started
contents:
- slug: intro # matched to the original entry by slug
page: Introduction
tags: New
- page: Pricing # no slug: matched by position
tags: [Limited, Hot]- Matching entries: an entry with a
slugmatches the original entry whose slug ends with the same segment; one without matches by position; tabs match by id. URLs, file paths and structure always come from the original; only what is shown changes. - What can change: section, page and link titles (
section,page,link), the titles ofapisections,changelogandfolder(api,title), tabdisplay-names, andtagswith theirtags-*settings. - The root
docs.ymloverlay can also set thedisplay-nameofversionsandproducts(and a product'ssubtitle, matched by order), andnavbar-links, which replace that language's header links as a whole. - Write only the fields that change; the rest come from the original and are then translated with
labels.yml. A language without its own file uses the default language's, as with missing translations. - Page frontmatter still wins:
sidebar-title,tagsand so on in a translation's frontmatter beat the values here.
Translate API specs
Text on endpoint pages comes from the OpenAPI spec. Put its translation at the same path under translations/<lang>/, in the same format; it can be partial:
tags:
- name: Payments
x-displayName: Payments
paths:
/payments/{id}:
get:
summary: Get payment
description: Returns a payment.
parameters:
- name: id
in: path
description: Payment id- Only its text is used:
summary,description,title,x-displayName, code samplelabels, enum descriptions, andexample/valuesamples. Endpoints, parameters, and URLs always come from the original spec, so an outdated translation can't change the API. - Anything not translated falls back in the order of Missing translations. Lists are matched by
name(plusinfor parameters) orurl, so adding or removing items in the original doesn't break translations. - Endpoint page URLs are the same in every language, whatever the translation.
- The API overview page (
summary) is translated like any page, at the same path undertranslations/<lang>/. - In the console: switch the preview to a language, open any endpoint page, and click Create … translation or Edit … translation at the top. A new one starts with every original text as a draft. You can also click text on the page to edit its translation; clear it to show the original again.
biti translateand AI translation on the platform translate spec text too; existing translations are kept until the original text changes.
Translate changelogs and blogs
Put an entry's translation at the same path under translations/<lang>/, with the same file name, for example translations/en/changelog/2026-11-20-v1.mdx:
- Title, tags, description, and body come from the translation. Date, URL, order, hidden, and draft always come from the original, so every language lists the same entries at the same URLs.
- Entries without a translation fall back in the order of Missing translations. A translation with
draft: truecounts as missing, so you can commit a half-finished one. - Tags are written per language; the filter lists the tags of the entries in the current language.
- The layout (timeline, classic, or blog) comes from the original
overview.mdx. If the translated overview has noauthors, the original's are used. - In the console: switch Viewing language and click an entry under the changelog to create or open its translation.
biti translateand AI translation on the platform translate entries and their tags too.
Language switching and hreflang
- The language switcher jumps to the same page in the other language (matched by tab id, section title, and page title), not to the home page.
- Every page's
<head>includes<link rel="alternate" hreflang="…" />for all language versions, plushreflang="x-default"pointing to the default language. - Every URL in
sitemap.xmlcarries language alternates asxhtml:link. - Each language has its own
llms.txtandllms-full.txt(/en/llms.txt). - Ask AI prioritizes content in the page's language and answers in the page's language.
Translate automatically with biti translate
export ANTHROPIC_API_KEY=sk-ant-...
biti translateThe command translates every source page that appears in the navigation into every language other than the source, writes them to the same path under translations/<lang>/, and fills in labels.yml (navigation titles and site texts; the site name is left to you). Existing entries, comments, and order in labels.yml are kept.
--to en,ja. Defaults to every language in docs.yml other than the source.ANTHROPIC_API_KEY, DEEPSEEK_API_KEY, or OPENROUTER_API_KEY environment variable.claude-opus-5-5 for Anthropic, deepseek-flash for DeepSeek, ~deepseek/deepseek-flash-latest for OpenRouter).Incremental translation and translation memory
- Pages are split into top-level blocks (paragraphs, headings, lists, components…), and each block is stored in
.biti/translation-memory.jsonkeyed by its content hash. - When a translation stops halfway, what is already translated is kept, and running it again continues from there.
- On later runs, unchanged blocks reuse the memory and only new or modified blocks are sent to the model — changing one sentence means translating only that sentence.
- Code blocks,
import/exportstatements,<CodeBlock>/<CodeGroup>, and block-level math are not translated. title,subtitle,description, andsidebar-titlein frontmatter are translated.- Hand-written
labels.ymlentries take precedence; AI only fills in missing labels.
Commit .biti/translation-memory.json to your repository, or runs in CI or on other machines will retranslate everything. The .gitignore generated by biti init ignores all of .biti/; to commit the translation memory, change that line to .biti/* and add a line !.biti/translation-memory.json.
Glossary
Set fixed translations for each language in translations/glossary.yml, and the model follows them strictly:
en:
站点: site
部署: deployment
预览部署: preview deployment
ja:
站点: サイト
部署: デプロイManage languages in the console
Turn on or add languages
Open the editor, go to Docs settings → Navigation, and under Languages click Turn on languages (on a single-language site) or Add, then enter a language code (such as en, ja or zh-TW) and a display name. When turning languages on, also enter the language of the current content; it becomes both the default and the source language.
Adjust and remove
Each language's display name can be changed, and its ⋯ menu makes it the default, moves it up or down, or deletes it. The language switcher follows the list order; reordering doesn't change the default language. Deleting only stops offering the language; translations under translations/<lang>/ are kept. Changing the default language only changes each language's URLs; source and translation files stay as they are, and the source language is labeled Source. The default and source languages can't be deleted. Viewing language above the navigation tree only changes which language you view and edit, not the default.
AI translation on the platform
Sites hosted on the ButterIX platform (hosted repository or connected Git) can translate the whole site with one click in the visual editor:
The corresponding APIs are POST /sites/{site}/editor/translate and GET /jobs/{id}.
Current limitations
The following content is not yet switched by language and shows the source text in every language:
| Content | Notes |
|---|---|
| Snippets | All languages share the same file; use <If locales> to differentiate |