ANTIGRAVITY LABJP
Articles/Editor View
Editor View/2026-09-10Intermediate

The File Counts Matched. 148 Pairs Disagreed on Code Blocks

My Japanese and English article trees matched at 1,057 files each, yet the bodies had quietly diverged. Here is what counting code blocks and H2 headings across every pair turned up, why a character-length ratio failed to catch any of it, and the 40-line checker I now run before every push.

i18n4quality gate3Markdown2Antigravity368repository ops

Premium Article

The message arrived one morning as a single line from a reader: the steps in the English version had no code in them.

I opened the Japanese page. Twenty-five code blocks. I opened the English one. None.

The counts had always matched. 1,057 files on the Japanese side, 1,057 on the English side. That number is what I check before every push, because a missing counterpart turns the language switcher into a 404, and I had put a guard there long ago.

The guard was counting files. What matched was the number of documents, not the number of things inside them.

Reviewing 1,057 pairs by eye was not going to happen. So I counted the things that should not change when a document is translated. What follows is that record.

I counted the contents, not the files

I limited the count to things whose quantity should survive translation: fenced code blocks, H2 headings, HTML tables, in-article links, and a few frontmatter keys. I did not compare prose. Translated prose is supposed to look different.

What I countedPairs that disagreedShare of 1,057 pairs
Missing English counterpart00%
Frontmatter premium10.1%
Frontmatter level10.1%
Number of tags121.1%
Frontmatter date161.5%
HTML tables181.7%
In-article links302.8%
Code blocks14814.0%
H2 headings19618.5%

Forty-nine pairs contain no code at all, so among the 1,008 pairs that do, the code-block mismatch rate is 14.7%. One in seven.

The gap between the top rows and the bottom rows is what stopped me. The two fields I had been guarding — premium and level — disagreed in 2 pairs out of 1,057. The body, where no guard existed, disagreed in 196.

A check watches the place it was pointed at. Everywhere else stays invisible, including the fact that it is invisible.

Four pairs where the English side had no code at all

I sorted by severity first. These are the pairs where the Japanese version has code blocks and the English version has zero.

Code blocks, JapaneseEnglishBody length (JA to EN)
25010,708 to 6,944
2307,980 to 5,025
16014,772 to 2,926
102,592 to 4,912

For anyone who came for the steps, the first three are simply not usable. The fourth is the odd one: the English body is longer than the Japanese, and the code still went missing.

One more pair had dropped from 22 blocks to 3. Because it is not zero, it looks healthy in any listing. Half-empty pages like that survive the longest.

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
You will be able to set a parity rule for your own bilingual repo based on measured structure counts rather than on file counts that always look green
You will know why a character-length ratio cannot guard a Japanese/English pair before you spend a week drowning in warnings from it
You will have a way to sort 148 mismatches into the handful that actually hurt readers and the rest that can wait
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

Antigravity 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 $15 for lifetime access
View Membership →

Related Articles

Editor View2026-09-03
How much of Antigravity's generated commit message I actually keep
Where the Review pane's generated commit message stops being enough, and where I start writing. A prepare-commit-msg hook that adds a Why trailer, plus measured behaviour during rebase, cherry-pick and revert.
Editor View2026-09-01
When YAML frontmatter rewrites your values without raising an error
Antigravity 2.11.0 renders frontmatter as a formatted card. Chasing the one file that refused to become a card turned up five patterns that parse cleanly but change the value. Here are the measured rules and a 40-line checker.
Editor View2026-08-27
Building a Verification Loop With Antigravity 2.10.0's Embedded Terminal
Antigravity 2.10.0 puts a terminal in the sidebar. Here is how I pinned my pre-merge checks down to three commands, scoped them to changed files only, and what the measured difference turned out to be.
📚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