fix(i18n): shorten language switcher + localize scenario badges#22
Merged
Conversation
The switcher showed the active locale's full native name (e.g. "Bahasa Indonesia"), making the header pill very wide. Render a compact uppercase code (EN/ZH/…) with a transparent native <select> overlaid, so the chip stays narrow and fixed-width while keyboard/screen-reader a11y and the full native names in the option list are preserved. Agent cards rendered scenario badges from the hardcoded `nameZh`, so they showed Chinese regardless of UI locale. Render them via the next-intl `Scenarios` namespace instead (matching the home tiles, /agents filter chips, and detail page). Same fix for the admin display chip; the admin editor's intentional bilingual option label is left as-is. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Two UI/i18n fixes on the agent marketplace.
1. Shorter language switcher. The header pill grew with the active locale's native name (worst case "Bahasa Indonesia", ~190px). It now shows a compact uppercase code (
EN/ZH/…) at a fixed ~81px, via a transparent native<select>overlay that keeps full keyboard/screen-reader accessibility and still shows the complete native names in the dropdown.2. Localized scenario badges. Agent cards hardcoded the Chinese
nameZh, so badges read "Agent框架 / 运维自动化 / 编程开发" even on the English UI. They now use the next-intlScenariosnamespace, matching the home tiles,/agentsfilter chips, and detail page. The admin display chip got the same fix (its bilingual editor option label is intentionally left bilingual).The 15-locale message catalogs were already complete (
check:i18npasses) — the gap was components bypassing i18n./agents(English)/zh/agents(中文)Verification
tsc --noEmit: 0 errors · ESLint: changed files clean ·check:i18n: all 15 locales match/agentsbadges English,/zh/agentsbadges Chinese and consistent with the filter chipsNotes
set-state-in-effectESLint warning inadmin/agentsis untouched.🤖 Generated with Claude Code