Skip to content

Commit d9553a4

Browse files
raifdmuellerclaude
andcommitted
fix(catalog): keep quick-nav aria-label i18n-reactive
The category quick-nav's <nav aria-label> was set only at render time, so a later language switch left it stale (applyTranslations only updates elements carrying data-i18n-aria). Add data-i18n-aria="nav.categoryJump" so the label follows the active language, matching the chips. Addresses CodeRabbit review on #549. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5ac798c commit d9553a4

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

website/src/components/card-grid.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ function renderCategoryNav(categories, allAnchors) {
121121
.join('')
122122

123123
return `
124-
<nav class="category-nav" aria-label="${escapeHtml(i18n.t('nav.categoryJump'))}">
124+
<nav
125+
class="category-nav"
126+
aria-label="${escapeHtml(i18n.t('nav.categoryJump'))}"
127+
data-i18n-aria="nav.categoryJump"
128+
>
125129
<ul class="category-nav-list">${links}</ul>
126130
</nav>
127131
`

website/src/components/card-grid.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ describe('category quick-nav', () => {
109109
expect(html).toContain('class="category-nav"')
110110
expect(html).toContain('href="#category-testing-quality"')
111111
expect(html).toContain('href="#category-design-principles"')
112+
// nav label must stay i18n-reactive on language switch
113+
expect(html).toContain('data-i18n-aria="nav.categoryJump"')
112114
})
113115

114116
it('omits categories with no non-umbrella anchors from the nav', () => {

0 commit comments

Comments
 (0)