Skip to content

P4a: render the hero name in the reader's script #27

Description

@mashkovd

Goal

The home page hero renders Dmitrii Mashkov as a single unpaired string. It should render Dmitrii Mashkov in English and Дмитрий Машков in Russian.

This is not a defect in #24. That pull request implemented its proposal exactly, and the proposal required the unpaired string. AGENTS.md was amended afterwards (#25) and that amendment does not reach backwards onto an already-approved proposal — so the change needs its own cycle and its own contract. This issue is that contract.

Why

AGENTS.md, site constraints:

The name is a translated string, not a proper noun exempt from it. English renders Dmitrii Mashkov, Russian renders Дмитрий Машков. They are the same person and different scripts, so the hero is an .l.en / .l.ru pair like any other copy, and it is set in Onest — Instrument Serif ships no Cyrillic and would drop the Russian half onto a fallback family. The <title> element holds one string and stays Latin; a browser tab is a filing label, not prose.

Every other string on the home page is properly bilingual. If the name stays the single exception it becomes the one element that looks machine-made, on a site whose whole argument is that it was not. A Russian reader shown a transliteration of a Russian name reads a page that was translated rather than written.

Note the earlier typography note claimed the name is "identical in both languages" and therefore safe in the editorial face. That was wrong: Дмитрий Машков and Dmitrii Mashkov are different scripts, which is exactly why Instrument Serif cannot set the Russian half.

Files expected to change

  • src/i18n/ui.ts — add heroName: { en: 'Dmitrii Mashkov', ru: 'Дмитрий Машков' }. Leave homeTitle exactly as it is: that is the <title> value and stays Latin on both sides.
  • src/pages/index.astro — render the <h1> through Lang with the new pair instead of the literal string.
  • src/styles/site.css — whatever rule sets the face for .hero-name must resolve to Onest, never Instrument Serif.
  • test/ui.test.ts or test/home.test.ts — assert that heroName has both locales and that they differ, so a future "simplification" back to one string fails the suite.

Copy

heroName.en Dmitrii Mashkov
heroName.ru Дмитрий Машков
homeTitle unchanged, Latin, both locales

Acceptance criteria

  1. The built dist/index.html contains Dmitrii Mashkov inside an element carrying class="l en" and Дмитрий Машков inside one carrying class="l ru".
  2. The .l.en and .l.ru counts on the page remain equal.
  3. The computed font-family for .hero-name resolves to Onest first, and Instrument Serif appears nowhere in that rule.
  4. <title> is Dmitrii Mashkov regardless of data-lang.
  5. npm test and npm run build pass; dist/ still contains no JavaScript.
  6. A test fails if heroName.en and heroName.ru are ever made identical.

Out of scope

🤖 Generated with Claude Code

https://claude.ai/code/session_01MPpAwcFk2L1B94VT8LiKVx

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions