1001Ferramentas
🌐 Dev

i18n Translation File Diff

Compares two i18n JSON files and reports missing, extra and empty keys plus placeholder mismatches between the two locales.

What breaks a locale file

A missing key usually shows the raw path on screen, which is ugly but obvious. The quiet failure is the placeholder that changed: if the reference says "Hi {name}" and the translation says "Olá", the interpolation argument is silently dropped and nobody notices until a user asks who the message was addressed to.

Nesting matters too. When one file has menu as an object and the other has menu as a string, most i18n libraries return the object and print [object Object]. That case shows up here as a structure conflict instead of a missing key, because renaming the key is rarely the right fix.

Find what is missing in a locale file

You spent the week editing pt.json and now need to know what en.json still lacks before the deploy. Paste both files and the comparison comes back split into sections: missing keys, extra keys, blank values and a coverage bar in percent. At the end there is a JSON skeleton of the missing keys alone, with the same nested shape and empty values, ready to paste into the other locale file.

Both files are flattened into dot paths before anything is compared, so menu.file.open and items.0 become plain keys and nesting stops getting in the way. On top of that comes the placeholder check, which understands the common formats at once: {name}, {{name}}, {0}, %s, %d, %1$s, ${name}, :name, the numbered Trans tags and the variable name inside ICU plural and select blocks.

The failure that slips through is not the missing key, which usually prints the raw path on screen. It is the placeholder that vanished in translation: if the reference says Hi {name} and the translation says Olá, the argument is dropped in silence. Watch the structure conflicts too, where menu is an object on one side and a string on the other — libraries tend to return the object and the interface shows [object Object].

Frequently asked questions

Does the comparison handle nested files?
Yes. Objects and arrays of any depth are flattened into dot-separated paths, with array indices becoming .0 and .1. A leaf key is a string, number, boolean or null. The output skeleton rebuilds the original shape, arrays included, whenever the indices run continuously from zero.
What counts as an empty value?
A blank string, a whitespace-only string and null all count as untranslated: they land in the empty section and stay out of the coverage figure. The number zero and the boolean false are not treated as empty, since they are legitimate values in files that mix configuration with text.
Why did a key show up as possibly untranslated?
Because the value is identical in both locales and longer than three characters. Sometimes that is correct, as with brand names and technical terms; sometimes it is the source text copied over and never translated. The option ships off so it will not flood the output of projects full of shared terms.

Related Tools