โจ Advertise a post's translation on the post page - #229
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
langattribute, since it addresses a reader who does not necessarily read the current one.Alertgainsinfo/warningvariants and aroleprop โalertis for something that just went wrong, and a standing note isnote.๐จ Semantic colour tokens โ templates reached for
dark-cyanandgolden-orangedirectly, naming the hue rather than the job.--infoand--warningnow point at those brand values and components ask for the role, so a palette change lands inapp.cssalone.--dark-cyan-softfollows as--info-soft.๐ Syntax theme reset โ
highlight.cssdrops back to the palettetempest/highlightships 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--info-softand theinfo/warningutilities emit correctlyNote 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.