Case study: Jest docs in 7 languages
Jest is the most widely used JavaScript testing framework, with over 100 million monthly npm downloads. Its documentation includes getting-started guides, configuration reference, a full API reference for matchers and mocks, and framework-specific guides for React, TypeScript, webpack, and more.
We translated the entire Jest documentation site into 7 languages: German, Spanish, French, Italian, Japanese, Portuguese (Brazilian), and Chinese (Simplified).
Why Jest is interesting
Jest's docs stress-test translation in ways that most documentation doesn't:
- API reference pages. The Expect API alone documents dozens of matchers like
toBe,toEqual,toHaveBeenCalledWith— each with code examples, parameter descriptions, and edge-case notes. These terms must stay as code, not be translated. - Tabbed content. Installation and configuration examples show npm, Yarn, pnpm, and Bun variants in tabs. The tab structure and all commands inside must be preserved exactly.
- Dense cross-references. Pages link to each other constantly — the Getting Started guide links to Using Matchers, which links to the API reference, which links to Configuration. Every link must continue to work in every language.
- Mixed prose and code on every page. A typical Jest doc page interleaves paragraphs of explanation with code blocks, inline code references like
jest.fn(), and configuration snippets. The boundary between "translate this" and "don't touch this" shifts every few lines.
What the output looks like
Full navigation translation
In the Japanese version, the entire navigation structure is translated:
- "Getting Started" → "はじめに"
- "Using Matchers" → "マッチャーの使い方"
- "Testing Asynchronous Code" → "非同期コードのテスト"
- "Setup and Teardown" → "セットアップとティアダウン"
- "Mock Functions" → "モック関数"
Category groups are translated too: "Guides" → "ガイド", "Framework Guides" → "フレームワークガイド". Even the footer sections — "Docs", "Community", "More", "Legal" — appear in Japanese.
Tabbed content preserved
Jest's installation instructions use tabbed UI components showing npm, Yarn, pnpm, and Bun variants. In every translated version:
- All four tabs render correctly
- Tab labels stay as "npm", "Yarn", "pnpm", "Bun" (correct — these are proper nouns)
- Commands inside each tab are untouched:
npm install --save-dev jeststays exactly as-is
Code blocks intact
Every code example on every page is preserved character-for-character:
const sum = require('./sum');
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});
This appears identically in German, Japanese, Chinese, and all other versions. Configuration examples, test file contents, CLI commands — none are modified.
Inline code references
References to API methods (expect, toBe, jest.fn()), file names (sum.test.js, babel.config.js), package names (@babel/preset-typescript, ts-jest), and CLI flags stay as code spans in every language. The surrounding explanation is translated; the code references are not.
Section headings
Headings are translated while keeping their anchor links functional:
- "Running from the Command Line" → "コマンドラインからの実行"
- "Additional Configuration" → "追加設定"
- "Using Babel" → "Babelの使用"
- "Using TypeScript" → "TypeScriptの使用"
Note that proper nouns like "Babel" and "TypeScript" are preserved in headings — they're not translated phonetically.
What we learned from Jest
API documentation is the hardest content type to translate well. Every page mixes natural language with dozens of code references. A single mistranslated code token — turning toBe into its Japanese equivalent — would break every test example on the page. Generic translation tools regularly make this mistake.
Tabbed UI components require structural understanding. The translation system needs to know that tabs are a UI container, not content to be translated or restructured. The content inside tabs follows different rules than the surrounding text.
Scale matters for consistency. Jest's docs span dozens of pages, each referencing the same API methods and configuration options. "Mock function" must translate to the same Japanese phrase on the Getting Started page, the Mock Functions guide, and the API reference. This only works if terminology is enforced globally, not page-by-page.
Browse it yourself
- German (Deutsch)
- Spanish (Español)
- French (Français)
- Italian (Italiano)
- Japanese (日本語)
- Portuguese (Português)
- Chinese Simplified (简体中文)
Jest is one of 19 open source projects we've translated as live demos. See also our Prettier case study.
If you maintain an open source project and want multilingual docs at no cost, apply to the Founding Partner Program. For commercial projects, contact us.