fix(ui): localize Dialog close and LanguageSwitcher group aria-labels
B-1: Dialog close button exposed French 'Fermer' to EN screen-reader users; B-2: switcher group label was English-only. New dict keys common.close + lang.group_label in both dicts (parity kept).
This commit is contained in:
1 parent
b7e6371f8a
commit
83f02c8fa8
4 files changed
+8
-2
No files matched your search
@@ -14,7 +14,7 @@ export default function LanguageSwitcher() {
|
||||
return (
|
||||
<div
|
||||
role="group"
|
||||
aria-label="Language"
|
||||
aria-label={t('lang.group_label')}
|
||||
className="inline-flex rounded-full border border-[var(--color-border)] overflow-hidden text-xs font-medium"
|
||||
>
|
||||
{ITEMS.map((item) => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useEffect, type ReactNode } from 'react'
|
||||
import { AnimatePresence, motion } from 'motion/react'
|
||||
import { useT } from '@/i18n/useT'
|
||||
|
||||
export interface DialogProps {
|
||||
open: boolean
|
||||
@@ -17,6 +18,7 @@ const SIZE: Record<NonNullable<DialogProps['size']>, string> = {
|
||||
}
|
||||
|
||||
export default function Dialog({ open, onClose, title, children, size = 'md' }: DialogProps) {
|
||||
const t = useT()
|
||||
useEffect(() => {
|
||||
if (!open) return
|
||||
const onKey = (e: KeyboardEvent) => e.key === 'Escape' && onClose()
|
||||
@@ -51,7 +53,7 @@ export default function Dialog({ open, onClose, title, children, size = 'md' }:
|
||||
<h2 className="text-lg font-semibold text-[var(--color-ink)]">{title}</h2>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="Fermer"
|
||||
aria-label={t('common.close')}
|
||||
onClick={onClose}
|
||||
className="rounded-md p-1 text-[var(--color-ink-muted)] hover:bg-[var(--color-surface-strong)]"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user