◉GEMINI LABJP
●CLI 0.71 — Gemini CLI v0.71.0 is out as a preview. The stable release is still v0.70.0●TOOL RETR — Tool retrieval (Preview) lets the model load tool definitions only when it needs them●2.5 ROUTE — From 12/1, gemini-2.5-pro routes to 3.8 Flash and 2.5-flash to 3.5 Flash-Lite, billed at the new rates (9 days left)●OAUTH — Users report a stored MCP OAuth token being sent to a repointed server URL without asking●PICK — Choosing a daily Gemini 4 model gets easier when you weigh reasoning, long context and price●AG NEON — Antigravity App v2.34.0 adds Gemini 4 Neon for Gemini API keys●CLI 0.71 — Gemini CLI v0.71.0 is out as a preview. The stable release is still v0.70.0●TOOL RETR — Tool retrieval (Preview) lets the model load tool definitions only when it needs them●2.5 ROUTE — From 12/1, gemini-2.5-pro routes to 3.8 Flash and 2.5-flash to 3.5 Flash-Lite, billed at the new rates (9 days left)●OAUTH — Users report a stored MCP OAuth token being sent to a repointed server URL without asking●PICK — Choosing a daily Gemini 4 model gets easier when you weigh reasoning, long context and price●AG NEON — Antigravity App v2.34.0 adds Gemini 4 Neon for Gemini API keys
Articles/API / SDK
◈ API / SDK/2026-06-19Advanced

Generate Japanese and English in One Structured Call to Stop Term Drift

Generating Japanese and English versions separately makes terminology drift article by article. Pair both languages in one Gemini 3.5 Flash structured-output call, pin a glossary, and detect drift mechanically — with measured results.

Gemini API256Structured Output12Multilingual3responseSchema6Gemini 3.5 Flash3

✦ Premium Article

Back when I generated the Japanese and English versions of an article in two separate calls, the part of my day that kept getting eaten was proofreading. Running paired bilingual posts at Dolice as an indie developer, the body would be correct, yet "streaming" would come out as streaming in one version and incremental delivery in the other. To a reader these are tiny snags, but when terminology wobbles from article to article, the quiet trust a site earns gets chipped away.

Most of that drift came from one thing: I was producing Japanese and English in two independent calls. The model picks "the most natural word right here" on each call, so when the calls are split, the wording splits too. In my own workflow I switched to putting both languages into a single structured output and fixing the glossary before generation. This article is the design, and a record of what actually changed after the switch.

Where the translation drifts when you generate separately

It helps to locate the drift first. When I generated the two languages independently, three spots wobbled most:

  1. Product and feature terms (e.g. rendering "思考" as both thinking and reasoning)
  2. UI labels and button text ("保存" as Save / Store / Keep)
  3. Heading granularity (Japanese gets 8 sections, English silently compresses to 6)

The third one is the nastiest. When the meaning matches but the structure does not, switching languages makes the reader feel they cannot return to the same article. My site pairs URLs across languages, so a structural mismatch becomes a step the reader trips over.

The root cause is that the two calls do not know each other's results. So the clean fix is to put both into one output and let the model decide them together.

Decide two things before writing the schema

Before any schema, pin down two things. Skip them and drift survives even with structured output.

First, a glossary: the terms you refuse to let wobble, held as Japanese, English, and a short usage note. Second, an output contract: the fields that must match across languages (section count, number of code blocks, and so on).

Keep the glossary in an external file and load it at generation time. A minimal shape:

{
  "glossary": [
    { "ja": "思考", "en": "thinking", "note": "Gemini's thinking feature; do not split into reasoning" },
    { "ja": "構造化出力", "en": "structured output", "note": "umbrella term when using responseSchema" },
    { "ja": "用語集", "en": "glossary", "note": "the topic here; do not translate as vocabulary" }
  ],
  "contract": { "min_sections": 6, "lang_pair": ["ja", "en"] }
}

Once "what should match" is written down, the rest is just schema and verification.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦A concrete responseSchema that pairs Japanese and English so two calls collapse into one
✦Pinning a glossary in the system instruction cut translation drift by about 45% — with the verification code
✦Mechanical drift detection via term presence and length ratio, plus a partial-regeneration fallback
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◈ API / SDK2026-05-21
When responseSchema enum returns unexpected values — debugging Gemini API
Why Gemini API sometimes returns values outside the enum in responseSchema, with a script to measure the leak rate on your own data and three layered fixes: prompt definitions, one capped retry, and an SDK version check.
◈ API / SDK2026-11-14
When JSON Shapes Drift Through Gemini's OpenAI Compatibility Layer: Three Steps to response_json_schema Without Rewriting Callers
If your OpenAI SDK code points at Gemini and structured output seems ignored, here is how to check whether a schema is actually sent, and how to move to the Gemini SDK's response_json_schema while keeping the same function boundary.
◈ API / SDK2026-06-12
Building an App Store Rejection Workflow with the Gemini API — From Structured Notices to Resolution Center Replies
How I use the Gemini API to parse App Store rejection notices into structured JSON, cross-check guidelines, draft Resolution Center replies, and run pre-submission checks as an indie developer.