Skip to content

โœจ Advertise a post's translation on the post page - #229

Merged
ker0x merged 4 commits into
mainfrom
feat/issue-000-blog-translation-notice
Aug 27, 2026
Merged

โœจ Advertise a post's translation on the post page#229
ker0x merged 4 commits into
mainfrom
feat/issue-000-blog-translation-notice

Conversation

@ker0x

@ker0x ker0x commented Aug 27, 2026

Copy link
Copy Markdown
Member

What

A reader landing on an English post had no signal the French version existed short of hunting for the locale switcher. This renders a notice above the post content pointing at the translation, plus the supporting design-token and tooling work that came with it.

Changes

โœจ Translation notice โ€” the post page loops over the alternates the resolver already returns, filtered to locales other than the current one. An untranslated post yields an empty list, so the block disappears without a guard. The notice is written in the target language and carries a matching lang attribute, since it addresses a reader who does not necessarily read the current one.

Alert gains info/warning variants and a role prop โ€” alert is for something that just went wrong, and a standing note is note.

๐ŸŽจ Semantic colour tokens โ€” templates reached for dark-cyan and golden-orange directly, naming the hue rather than the job. --info and --warning now point at those brand values and components ask for the role, so a palette change lands in app.css alone. --dark-cyan-soft follows as --info-soft.

๐Ÿ’„ Syntax theme reset โ€” highlight.css drops back to the palette tempest/highlight ships with, as the starting point for restyling the code surface against the new tokens.

๐Ÿ“ Markdown styleguide โ€” checking prose styles after a design change meant hunting the archive for a post that happened to contain a table or a footnote. This renders every construct the parser understands on one page. It carries draft: true, so it lists locally and stays off production.

Testing

Three integration tests cover the notice: French advertised on an English post, English on a French post, and nothing at all on an untranslated one.

  • ShowControllerTest โ€” 15 tests, 46 assertions, green
  • PHPStan level 8 โ€” no errors
  • Twig CS Fixer โ€” 99 files, 0 notices
  • Twig/YAML lint + Doctrine mapping โ€” OK
  • Tailwind build โ€” --info-soft and the info/warning utilities emit correctly

Note for review

The syntax theme is a deliberate reset, not a finished design โ€” code blocks currently sit on a hardcoded dark surface in both themes. Restyling it against the new tokens is follow-up work, and the styleguide post exists to make that easy to check.

ker0x added 4 commits August 27, 2026 15:38
Templates reached for `dark-cyan` and `golden-orange` directly, which named
the hue rather than the job it was doing. Point `--info` and `--warning` at
those brand values and let components ask for the role instead, so a palette
change lands in app.css alone.

`--dark-cyan-soft` follows the same move and becomes `--info-soft`, keeping
the timeline dot halo defined -- the utility had already been renamed.
A reader landing on an English post had no signal the French version existed
short of hunting for the locale switcher. Render a notice above the content
for every alternate the resolver returns, which is none for an untranslated
post, so the block disappears on its own.

The notice is written in the target language and carries a matching `lang`,
since it addresses a reader who does not necessarily read the current one.
Alert gains `info`/`warning` variants and a `role` prop -- `alert` is for
something that just went wrong, and a standing note is `note`.
Swaps the token-derived `.hl-*` colours for the palette tempest/highlight
ships with, as the starting point for restyling the code surface against
the new tokens.
Checking the prose styles after a design change meant hunting the archive
for a post that happened to contain a table or a footnote. This renders
every construct the parser understands on one page.

It carries `draft: true`, so it lists locally and stays off production.
@ker0x
ker0x merged commit 46cabc2 into main Aug 27, 2026
1 check passed
@ker0x
ker0x deleted the feat/issue-000-blog-translation-notice branch August 28, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant