GEMINI LABJP
FLASH — Gemini 3.5 Flash is now generally available, billed as the most intelligent model for agentic and coding tasksTIER — New tiers like 3.1 Pro and 3.1 Flash-Lite are rolling into apps, cloud products, and business toolsPIXEL — The June Pixel Drop adds Gemini music generation, AI video and music creation, and screen-recording reactionsOMNI — Gemini Omni (creation), 3 Deep Think (reasoning), and Deep Research (automation) all advance in parallelLIVE — Gemini Live's real-time interaction is expanding across Android, Search, YouTube, and connected Google appsULTRA — Google AI Ultra offers top model access, Deep Research, Veo 3 video, and a 1M-token context windowFLASH — Gemini 3.5 Flash is now generally available, billed as the most intelligent model for agentic and coding tasksTIER — New tiers like 3.1 Pro and 3.1 Flash-Lite are rolling into apps, cloud products, and business toolsPIXEL — The June Pixel Drop adds Gemini music generation, AI video and music creation, and screen-recording reactionsOMNI — Gemini Omni (creation), 3 Deep Think (reasoning), and Deep Research (automation) all advance in parallelLIVE — Gemini Live's real-time interaction is expanding across Android, Search, YouTube, and connected Google appsULTRA — Google AI Ultra offers top model access, Deep Research, Veo 3 video, and a 1M-token context window
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 API143Structured Output7Multilingual3responseSchema4Gemini 3.5 Flash2

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 you defined in responseSchema, and the three-layer workaround I use in production for my wallpaper app classification pipeline.
API / SDK2026-06-20
Gemini API Grounding × Structured Output Guide — Turn Web Search Results into Typed JSON Data
Combine Gemini API Grounding with Google Search and Structured Output to extract real-time web information as type-safe JSON data. Practical implementation patterns included.
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.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →