Skip to content

Commit 93d10b5

Browse files
committed
chore: add long aria label link description
1 parent 950ad13 commit 93d10b5

8 files changed

Lines changed: 76 additions & 7 deletions

File tree

app/pages/about.vue

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,26 @@ function onMouseLeave() {
173173
}
174174
}, 120)
175175
}
176+
177+
// --- Add this helper function ---
178+
function getAriaLabel(c: GitHubContributor): string {
179+
const separator = $t('about.contributors.separator')
180+
const role = roleLabels.value[c.role]
181+
? $t('about.contributors.role', { separator, role: roleLabels.value[c.role] })
182+
: ''
183+
const works_at = c.company
184+
? $t('about.contributors.works_at', { separator, company: c.company })
185+
: ''
186+
const location = c.location
187+
? $t('about.contributors.location', { separator, location: c.location })
188+
: ''
189+
return $t('about.contributors.view_profile_detailed', {
190+
name: c.name || c.login,
191+
role,
192+
works_at,
193+
location,
194+
})
195+
}
176196
</script>
177197

178198
<template>
@@ -330,7 +350,11 @@ function onMouseLeave() {
330350
<LinkBase
331351
:id="`anchor-${contributor.id}`"
332352
:to="contributor.html_url"
333-
:aria-label="$t('about.contributors.view_profile', { name: contributor.login })"
353+
:aria-label="
354+
isExpandable(contributor)
355+
? getAriaLabel(contributor)
356+
: $t('about.contributors.view_profile', { name: contributor.login })
357+
"
334358
no-underline
335359
no-external-icon
336360
class="group relative block h-12 w-12 rounded-lg transition-all outline-none focus-visible:(ring-2 ring-accent z-20)"

i18n/locales/en.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,12 @@
834834
"loading": "Loading contributors...",
835835
"error": "Failed to load contributors",
836836
"view_profile": "View {name}'s GitHub profile",
837-
"avatar": "{name}'s avatar"
837+
"avatar": "{name}'s avatar",
838+
"view_profile_detailed": "View {name}'s GitHub profile{role}{works_at}{location}",
839+
"separator": "",
840+
"role": "{separator}{role} at npmx.dev",
841+
"works_at": "{separator}works at {company}",
842+
"location": "{separator}based in {location}"
838843
},
839844
"get_involved": {
840845
"title": "Get involved",

i18n/locales/es.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,12 @@
827827
"loading": "Cargando colaboradores...",
828828
"error": "Error al cargar colaboradores",
829829
"view_profile": "Ver perfil de GitHub de {name}",
830-
"avatar": "avatar de {name}"
830+
"avatar": "avatar de {name}",
831+
"view_profile_detailed": "Ver el perfil de GitHub de {name}{role}{works_at}{location}",
832+
"separator": "",
833+
"role": "{separator}{role} en npmx.dev",
834+
"works_at": "{separator}trabaja en {company}",
835+
"location": "{separator}ubicado en {location}"
831836
},
832837
"get_involved": {
833838
"title": "Involúcrate",

i18n/schema.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,6 +2508,21 @@
25082508
},
25092509
"avatar": {
25102510
"type": "string"
2511+
},
2512+
"view_profile_detailed": {
2513+
"type": "string"
2514+
},
2515+
"separator": {
2516+
"type": "string"
2517+
},
2518+
"role": {
2519+
"type": "string"
2520+
},
2521+
"works_at": {
2522+
"type": "string"
2523+
},
2524+
"location": {
2525+
"type": "string"
25112526
}
25122527
},
25132528
"additionalProperties": false

lunaria/files/en-GB.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,12 @@
833833
"loading": "Loading contributors...",
834834
"error": "Failed to load contributors",
835835
"view_profile": "View {name}'s GitHub profile",
836-
"avatar": "{name}'s avatar"
836+
"avatar": "{name}'s avatar",
837+
"view_profile_detailed": "View {name}'s GitHub profile{role}{works_at}{location}",
838+
"separator": "",
839+
"role": "{separator}{role} at npmx.dev",
840+
"works_at": "{separator}works at {company}",
841+
"location": "{separator}based in {location}"
837842
},
838843
"get_involved": {
839844
"title": "Get involved",

lunaria/files/en-US.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,12 @@
833833
"loading": "Loading contributors...",
834834
"error": "Failed to load contributors",
835835
"view_profile": "View {name}'s GitHub profile",
836-
"avatar": "{name}'s avatar"
836+
"avatar": "{name}'s avatar",
837+
"view_profile_detailed": "View {name}'s GitHub profile{role}{works_at}{location}",
838+
"separator": "",
839+
"role": "{separator}{role} at npmx.dev",
840+
"works_at": "{separator}works at {company}",
841+
"location": "{separator}based in {location}"
837842
},
838843
"get_involved": {
839844
"title": "Get involved",

lunaria/files/es-419.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,12 @@
826826
"loading": "Cargando colaboradores...",
827827
"error": "Error al cargar colaboradores",
828828
"view_profile": "Ver perfil de GitHub de {name}",
829-
"avatar": "avatar de {name}"
829+
"avatar": "avatar de {name}",
830+
"view_profile_detailed": "Ver el perfil de GitHub de {name}{role}{works_at}{location}",
831+
"separator": "",
832+
"role": "{separator}{role} en npmx.dev",
833+
"works_at": "{separator}trabaja en {company}",
834+
"location": "{separator}ubicado en {location}"
830835
},
831836
"get_involved": {
832837
"title": "Involúcrate",

lunaria/files/es-ES.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,12 @@
826826
"loading": "Cargando colaboradores...",
827827
"error": "Error al cargar colaboradores",
828828
"view_profile": "Ver perfil de GitHub de {name}",
829-
"avatar": "avatar de {name}"
829+
"avatar": "avatar de {name}",
830+
"view_profile_detailed": "Ver el perfil de GitHub de {name}{role}{works_at}{location}",
831+
"separator": "",
832+
"role": "{separator}{role} en npmx.dev",
833+
"works_at": "{separator}trabaja en {company}",
834+
"location": "{separator}ubicado en {location}"
830835
},
831836
"get_involved": {
832837
"title": "Involúcrate",

0 commit comments

Comments
 (0)