Skip to content

Add temporary pre-catalog Translatathon promo banner - #9307

Merged
iHiD merged 3 commits into
mainfrom
translatathon-banner
Jul 31, 2026
Merged

Add temporary pre-catalog Translatathon promo banner#9307
iHiD merged 3 commits into
mainfrom
translatathon-banner

Conversation

@iHiD

@iHiD iHiD commented Jul 30, 2026

Copy link
Copy Markdown
Member

What

A temporary announcement bar recruiting translators for the Big Jiki & Exercism Translatathon, shown to signed-in users whose browser's top language is one we don't ship the UI in.

This is the server-side sibling of the Jiki front-end's TranslatathonBanner. Same core logic, adapted to how this site does banners: it's a Ruby announcement bar in the site-header helper, not a React component.

How it works

  • ViewComponents::TranslatathonBanner resolves the ordered Accept-Language request header (the server-side equivalent of the front-end's navigator.languages, ordered by q-value).
  • It takes the first non-catalog language in that list. English is the only catalog language on Exercism, so English speakers see nothing and fall through to the existing bars.
  • A language in the Translatathon program gets the whole banner in that language (COPY map, RTL-aware for ar/fa/ur).
  • Any other named non-English language gets the English fallback with its name filled in (e.g. "Want to help us translate Jiki to Swedish?"). Ruby has no Intl.DisplayNames, so names come from a LANGUAGE_NAMES map; a code we can't name shows nothing.
  • Self-removes after the event (hardcoded END_TIME = 2026-08-04).
  • The bar links to https://i18n.jiki.io, opening in a new tab.

Mounting

Wired into SiteHeader#announcement_bar, following the existing announcement-bar pattern. It takes priority over the other bars for signed-in users when it applies. Signed-out users are never affected (and their header stays cached).

Notes vs the front-end PR

  • No dismissal / no client-side rendering. The announcement bar is server-rendered and non-dismissible by convention here, so the localStorage dismiss logic and full-screen-exercise suppression from the FE version are dropped.
  • Temporary by design: delete TranslatathonBanner, its test, and the header hook after the event.

Unit-tested in test/helpers/view_components/translatathon_banner_test.rb (Accept-Language ordering, catalog exclusion, program/variant mapping, English fallback, end-date cutoff).

🤖 Generated with Claude Code

iHiD and others added 3 commits July 31, 2026 01:17
Recruit translators for the Big Jiki & Exercism Translatathon via the
site-header announcement bar, shown to signed-in users only.

This is the server-side sibling of the Jiki front-end's TranslatathonBanner
(jiki-education/front-end#990). Rather than reaching for navigator.languages
in JS, ViewComponents::TranslatathonBanner resolves the ordered Accept-Language
request header: it takes the first non-catalog language (English is the only
catalog language on Exercism) and returns either the banner fully translated
into a Translatathon-program language, or an English fallback with the
language's name filled in. It self-removes after the event (END_TIME).

Wired into SiteHeader#announcement_bar following the existing bar pattern; no
dismissal or client-side rendering since the announcement bar is server-only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WxnG32jG7Zdy2Uu6qFCPjp
The banner lives on the Exercism site, so the recruiting copy should name
Exercism as the thing being translated. Swap "Jiki" for "Exercism" in every
translated string and the English fallback, adjusting the Korean object
particle (를 -> 을) and Turkish accusative ('yi -> 'i) for the new consonant
ending. The event name and front-end reference in the comments are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WxnG32jG7Zdy2Uu6qFCPjp
Use margin-inline-end instead of physical mr-6 so the gap sits between the
globe emoji and the text in both LTR and RTL banners (previously the emoji
jammed against the text in RTL). Tightened to 8px.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@iHiD
iHiD merged commit f1c82f6 into main Jul 31, 2026
40 checks passed
@iHiD
iHiD deleted the translatathon-banner branch July 31, 2026 12:00
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.

2 participants