Keep the whitespace around translated runs #177

Merged
paulhitt merged 1 commits from i18n/spanish-landing-whitespace into main 2026-09-09 20:09:40 +00:00
paulhitt commented 2026-09-09 20:09:22 +00:00 (Migrated from gitlab.com)

A defect in how I generated the Spanish landing page, caught on the live site.

Replacing each text run with the translation of its whitespace-normalised form drops the run's own leading and trailing spaces. Where a run sits next to an inline tag, the two then glue together: Simple, private <span>messaging</span> came out as privadamensajeria.

Two fixes:

  • Each run keeps its own leading and trailing whitespace.
  • The extraction threshold was 12 characters, so short runs inside a span were skipped entirely rather than translated. Lowered, which took the page from 97 replaced runs to 127.

Checked mechanically rather than by eye: tag sequence identical, Leaf directives identical, 51 inline joins compared against the English, no suspiciously long words left anywhere in the rendered text.

Tests: 697, 0 failures.

A defect in how I generated the Spanish landing page, caught on the live site. Replacing each text run with the translation of its whitespace-*normalised* form drops the run's own leading and trailing spaces. Where a run sits next to an inline tag, the two then glue together: `Simple, private <span>messaging</span>` came out as **privadamensajeria**. Two fixes: - Each run keeps its own leading and trailing whitespace. - The extraction threshold was 12 characters, so short runs inside a span were skipped entirely rather than translated. Lowered, which took the page from 97 replaced runs to 127. Checked mechanically rather than by eye: tag sequence identical, Leaf directives identical, 51 inline joins compared against the English, no suspiciously long words left anywhere in the rendered text. Tests: 697, 0 failures.
paulhitt (Migrated from gitlab.com) merged commit 6a3d45af66 into main 2026-09-09 20:09:40 +00:00
paulhitt commented 2026-09-09 20:09:41 +00:00 (Migrated from gitlab.com)

mentioned in commit 6a3d45af66

mentioned in commit 6a3d45af6624d43eb952799824777737b7568517
Sign in to join this conversation.