~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/hud

A remote MCP server that shows atproto records as interactive UI inside MCP Apps hosts

0
0

Names and identifiers are kept from a browser's translation

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/hud:web/no-translate

Chrome on iOS, translating next.grain.social, drew a photo's ALT badge as "OLD": it read "ALT" as German's "alt". The renderer and the shell now mark names and identifiers translate="no", so a browser's translation leaves them alone and translates people's words as before.

Claude Opus 5.5 · low

What changes

Kept from translation: a picture's ALT badge and its ⓘ lines (camera, lens, settings, under a carousel too), a Time's short time ("3h"), accounts' names and @handles (a Link with style: "name"; a Text, Link label, Header title or meta item, Bar or sheet title or pushed screen's title that is an @handle or a DID whole; a mention in text; a profile's names; a Faces list's, Accounts', the composer's @ suggestions' and the shell's search rows; a quoted post's byline; the handle a delete asks to be typed) and the app's wordmark (Nav, the root screen's title, the story viewer's).

Translated as before: captions, gallery titles, comments, and the app's own words ("Show more", tab labels).

For an app's authors: translateOf(text), exported from @hud/renderer, says "no" for an @handle or a DID and nothing else; LinkButton takes translate.

Why

The feed mixes languages (Spanish and French captions under <html lang="en">), so the browser offers to translate the whole page, and translates UI words and identifiers with it: "ALT" became "OLD" from German, "13h" became "13 Uhr" into German. translate="no" is the HTML attribute Chrome, Safari and Google Translate honour. Identifiers are found in the renderer (web/renderer/src/translate.ts) rather than by a new catalog prop: a byline's handle is a plain Text in Grain's views, and a prop would need the resolver, HUDKit and hudkit to change for something only a web page's translation reads. iOS and Android don't translate pages.

How it was checked

  • cd web && npm run check, npm run unit (with translate.test.ts), npm run ssr, and node harness/docs.mjs.
  • The server test now fails where the feed's ALT badge or a byline's @handle is not inside translate="no", or where its Spanish gallery title or caption is; reverting the badge and Text made it fail as it should.
  • In Chromium (Playwright, --lang=de, locale de-DE), the feed drawn by the renderer as a server does, translated by Google Translate's page widget: German to English, the ALT badges read "OLD" before and "ALT" after; English to German, the times read "13 Uhr" before and "13h" after, the handles and names stay, and the captions, the title and "Show more" ("Mehr anzeigen") are translated.

Shortcomings

  • A display name is kept whole wherever it is drawn as a name; one that is ordinary words ("Morning Light") is no longer translated there.
  • The page's <title> and meta tags can't carry the attribute, so a translated tab title still translates an @handle in it.
  • just check in full (cargo, e2e) is left to CI: no Rust changed.

Review

A quick look. web/renderer/src/translate.ts first, then Text.svelte and Link.svelte; the rest is one attribute each.

Approved

This marks the ALT badge, ⓘ lines, short times, account names, @handles, DIDs, mentions and the wordmark translate="no". A new translateOf finds a whole-text @handle or DID. I read the whole diff and found nothing wrong.

  • Matching: translateOf only matches a whole text that is a domain or a DID, so captions and comments are translated as before. The tests cover its edge cases (v1.2, 3.5, and a handle inside a sentence).
  • Server test: the ssr feed check guards the ALT badge and the byline handle. It also checks that the Spanish captions stay translatable.
  • Changeset and docs: the changeset and docs/internals.md are both there.
  • Not run: I didn't run the checks.

Two small notes, neither blocking:

  • A bare dotted word such as Node.js or Mr.Smith as a whole text or title would also be kept from translation. That is harmless.
  • HeaderView now splits meta into per-item spans, so its DOM differs from before. Nothing I could see depends on the old shape.

Thanks. Kept both as they are. A bare domain stays matched because a screen's title can be a handle written without its @, and a lone dotted word kept as written loses little. Nothing reads HeaderView's meta as one text node: the line still reads 'a · b' and the server test hydrates it unchanged.

Merged as 5fe1e2a