chore(i18n): drop dead dict keys, wire LanguageSwitcher through dict
6 keys unused in both dicts removed (common.back, common.none, editors.title, lateral.bilateral, lateral.unpaired, pdf.export_date_prefix). LanguageSwitcher hardcoded strings identical to existing lang.* keys — now reads them via t(); rendered output unchanged (values identical in both dicts).
This commit is contained in:
1 parent
bbdc0e851a
commit
4ea8c90c7f
3 files changed
+7
-17
No files matched your search
@@ -1,14 +1,16 @@
|
||||
import { useLocaleStore } from '@/state/localeStore'
|
||||
import { useT } from '@/i18n/useT'
|
||||
import type { Locale } from '@/i18n/types'
|
||||
|
||||
const ITEMS: { value: Locale; label: string; ariaLabel: string }[] = [
|
||||
{ value: 'fr', label: 'FR', ariaLabel: 'Passer en français' },
|
||||
{ value: 'en', label: 'EN', ariaLabel: 'Switch to English' },
|
||||
const ITEMS: { value: Locale; labelKey: string; ariaKey: string }[] = [
|
||||
{ value: 'fr', labelKey: 'lang.fr', ariaKey: 'lang.switch_to_fr' },
|
||||
{ value: 'en', labelKey: 'lang.en', ariaKey: 'lang.switch_to_en' },
|
||||
]
|
||||
|
||||
export default function LanguageSwitcher() {
|
||||
const locale = useLocaleStore((s) => s.locale)
|
||||
const setLocale = useLocaleStore((s) => s.setLocale)
|
||||
const t = useT()
|
||||
return (
|
||||
<div
|
||||
role="group"
|
||||
@@ -21,7 +23,7 @@ export default function LanguageSwitcher() {
|
||||
<button
|
||||
key={item.value}
|
||||
type="button"
|
||||
aria-label={item.ariaLabel}
|
||||
aria-label={t(item.ariaKey)}
|
||||
aria-pressed={active}
|
||||
onClick={() => setLocale(item.value)}
|
||||
className={[
|
||||
@@ -31,7 +33,7 @@ export default function LanguageSwitcher() {
|
||||
: 'text-[var(--color-ink)] hover:bg-[var(--color-surface-strong)]',
|
||||
].join(' ')}
|
||||
>
|
||||
{item.label}
|
||||
{t(item.labelKey)}
|
||||
</button>
|
||||
)
|
||||
})}
|
||||
|
||||
@@ -6,14 +6,12 @@ export const en: Dict = {
|
||||
'common.confirm': 'Confirm',
|
||||
'common.delete': 'Delete',
|
||||
'common.add': 'Add',
|
||||
'common.back': 'Back',
|
||||
'common.home': 'Home',
|
||||
'common.understood': 'Got it',
|
||||
'common.collapse': 'Collapse',
|
||||
'common.expand': 'Expand',
|
||||
'common.move_up': 'Move up',
|
||||
'common.move_down': 'Move down',
|
||||
'common.none': 'None',
|
||||
'common.back_to_home': 'Back to home',
|
||||
|
||||
'home.new_report.title': 'New report',
|
||||
@@ -37,7 +35,6 @@ export const en: Dict = {
|
||||
'footer.in_partnership': 'In partnership with',
|
||||
|
||||
// editors page
|
||||
'editors.title': 'Editors',
|
||||
'editors.svg.title': 'SVG Editor',
|
||||
'editors.svg.description':
|
||||
'Annotate an anatomical SVG file: add clickable zones, categories, and FR/EN labels.',
|
||||
@@ -135,8 +132,6 @@ export const en: Dict = {
|
||||
'lateral.both': 'Both',
|
||||
'lateral.left_short': 'L',
|
||||
'lateral.right_short': 'R',
|
||||
'lateral.bilateral': 'Bilateral',
|
||||
'lateral.unpaired': 'Unilateral',
|
||||
|
||||
'severity.aria': 'Severity',
|
||||
'severity.légère': 'mild',
|
||||
@@ -159,7 +154,6 @@ export const en: Dict = {
|
||||
'pdf.empty': '—',
|
||||
'pdf.owner_prefix': 'Owner: ',
|
||||
'pdf.siret_prefix': 'SIRET ',
|
||||
'pdf.export_date_prefix': 'Exported on ',
|
||||
'pdf.title.suffix.bilan': 'Faunosteo — ',
|
||||
'pdf.subject': 'Animal osteopathic report',
|
||||
|
||||
|
||||
@@ -7,14 +7,12 @@ export const fr: Dict = {
|
||||
'common.confirm': 'Valider',
|
||||
'common.delete': 'Supprimer',
|
||||
'common.add': 'Ajouter',
|
||||
'common.back': 'Retour',
|
||||
'common.home': 'Accueil',
|
||||
'common.understood': 'Compris',
|
||||
'common.collapse': 'Réduire',
|
||||
'common.expand': 'Développer',
|
||||
'common.move_up': 'Monter',
|
||||
'common.move_down': 'Descendre',
|
||||
'common.none': 'Aucun',
|
||||
'common.back_to_home': "Retour à l'accueil",
|
||||
|
||||
// home
|
||||
@@ -41,7 +39,6 @@ export const fr: Dict = {
|
||||
'footer.in_partnership': 'En partenariat avec',
|
||||
|
||||
// editors page
|
||||
'editors.title': 'Éditeurs',
|
||||
'editors.svg.title': 'Éditeur SVG',
|
||||
'editors.svg.description':
|
||||
'Annoter un fichier SVG anatomique : ajouter des zones cliquables, catégories et labels FR/EN.',
|
||||
@@ -149,8 +146,6 @@ export const fr: Dict = {
|
||||
'lateral.both': 'Les deux',
|
||||
'lateral.left_short': 'G',
|
||||
'lateral.right_short': 'D',
|
||||
'lateral.bilateral': 'Bilatéral',
|
||||
'lateral.unpaired': 'Unilatéral',
|
||||
|
||||
// severity
|
||||
'severity.aria': 'Sévérité',
|
||||
@@ -175,7 +170,6 @@ export const fr: Dict = {
|
||||
'pdf.empty': '—',
|
||||
'pdf.owner_prefix': 'Propriétaire : ',
|
||||
'pdf.siret_prefix': 'SIRET ',
|
||||
'pdf.export_date_prefix': 'Exporté le ',
|
||||
'pdf.title.suffix.bilan': 'Bilan ostéo — ',
|
||||
'pdf.subject': "Bilan d'ostéopathie animalière",
|
||||
|
||||
|
||||
Reference in new issue
Block a user