ChatbotX icon indicating copy to clipboard operation
ChatbotX copied to clipboard

es.json: a glossary replace without word boundaries put Spanish inside English words, damaging 242 of 4765 keys across 48 blocks

Open rawdaymx opened this issue 2 months ago • 0 comments

Summary

apps/builder/messages/es.json has not been half-translated — it has been damaged by a glossary replace that ran without word boundaries and in more than one pass. The signature is Spanish appearing inside English words:

  • Call became Ctodos, because all was replaced with todos
  • Stage became Setiquetae, because tag was replaced with etiqueta
  • Unsubscribed became Cancelar suscripciond, leaving the d behind
  • to became un, which is what you get if to was replaced with a and a later pass replaced a with un

Those four are not judgement calls about translation quality. A Spanish reader cannot parse Incoming Ctodos, and no translator produces it.

Extent, measured key by key against en.json: 242 of the 4765 keys in es.json contain English words that Spanish never uses in that position, spread across 48 top-level blocks. The worst-hit are whatsapp (43), trigger (24), contactScan (16), channels (12), fields (11), flows (10), messages (10), messenger (10), workspace (9), tiktokCommentAutomation (9).

What isolates it. This is not "the translation is mediocre" and not "some keys are missing". All 4765 keys are present — es.json and en.json have exactly the same key set, and none of the 57 trigger.* values is a verbatim copy of its English source. The values were translated; the translation tool corrupted them.

Environment

Measured against upstream/main = e4913ef2a
How Loaded en.json and es.json from that commit, flattened both to dotted keys and compared them value by value

Measurement

The defect is established by reading the two files, so there is no user-facing Actual: that we observed in a browser for every one of the 242. The strings below are what the pickers and banners render.

Samples from four different blocks:

Key en.json es.json
fields.authCallbackUrl.label Auth Callback URL Auth Ctodosback URL
fields.signInCallbackUrl.label Sign-in Callback URL Sign-in Ctodosback URL
messenger.messageTemplate.create.callPhoneNumber Call Phone Number Ctodos Telefono Number
trigger.conditions.incomingCall Incoming Call Incoming Ctodos
trigger.conditions.ticketMovedToStage Ticket Moved To Stage Ticket Moved un Setiquetae
channels.duplicated.generic This account is already connected to another workspace. This cuenta es already connected un another espacio de trabajo.
channels.reconnect.errors.notFound The channel to reconnect was not found. The canal un reConectar was no encontrado.
workspace.deletion.bannerDescription This workspace is scheduled for deletion. Undo the deletion below to continue using it. This espacio de trabajo es scheduled para deletion. Undo el deletion below un continue using it.

The last three are error and banner copy, so a Spanish-speaking user hits them exactly when something has gone wrong.

Why the existing gate does not catch this

pnpm --filter builder i18n:check compares key sets, not values. Run against the damaged file and against the repaired one, it gives the same answer:

# es.json as it is on e4913ef2a
No invalid translations found!      exit 0

# es.json with the trigger.* block repaired
No invalid translations found!      exit 0

So nothing in CI can see this, which is presumably why it survived.

Where it comes from

apps/builder/messages/es.json. The damage is in the values only; keys, ICU placeholders ({count}, {startTime}) and plural forms are intact everywhere we looked.

Why we think this is a defect rather than the intended design

There is no reading of Auth Ctodosback URL as a deliberate choice. The only alternative explanation would be that es.json is a machine-generated artifact not meant to be read as final copy, and the file does not say that — it sits beside the other 20 locale files and is served to users.

Suggested fix

The attached PR repairs one block, trigger.* (29 of the 57 values), as a reviewable first slice — the same shape as #1328/#1329, which you merged for facebookCommentAutomation and instagramCommentAutomation. We are happy to keep going block by block in follow-up PRs if that is useful.

Two things worth deciding before more of it is hand-repaired, which is why the rest is in this issue and not in the PR:

  1. If the original glossary run can be repeated with word-boundary matching, regenerating es.json is likely cheaper and more consistent than 242 hand edits — and the same run probably damaged other locales we have not audited.
  2. A value-level check would stop this recurring. The cheapest version that would have caught all four signatures is a test asserting no es.json value contains a short list of English function words (This, was, already, the, not, …). We can offer that separately if you want it.

What we did not verify

  • We only audited es.json. The other 19 non-English locales were not checked, so we do not know whether the same run damaged them. The Ctodos/Setiquetae signatures are Spanish-specific, but the mechanism is not.
  • Our 242 count comes from a word list of unmistakable English words. It is a floor, not a total: a value that is wrong in a subtler way (wrong word, right language) is not in it. Conversely we checked the samples above by hand, so the floor is not inflated.
  • The 29 values in the PR were translated by a native Spanish speaker but have not been through a professional translation review.
  • We did not open each of the 242 strings in the running UI to confirm which screen shows it; the claim is about the catalogue's contents.
  • trigger.triggers.title is Desencadenadores, a literal rendering of Triggers that reads oddly as a product name in Spanish. We left it alone: that is a naming decision, not a defect.

Related issues - none of these describes it

  • #1328 / PR #1329 (merged) are the same family for facebookCommentAutomation and instagramCommentAutomation, and that PR is the precedent for the slice offered here. They did not cover trigger.* or the other 46 blocks.
  • #1330 / PR #1331 (merged) fixed the (optional) marker being a hard-coded English literal — a different mechanism (missing key, not damaged value).
  • Searched this repository's issues for translation, i18n and Spanish. Nothing open covers the catalogue damage. The search instrument was confirmed against a query that does return results.

rawdaymx avatar Oct 02 '26 19:10 rawdaymx