Skip to content

Commit 92cd89d

Browse files
committed
feat: implement translations for chart sr sections
1 parent bf4a657 commit 92cd89d

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

app/components/Compare/FacetBarChart.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ function buildExportFilename(extension: string): string {
113113
const config = computed<VueUiHorizontalBarConfig>(() => {
114114
return {
115115
theme: isDarkMode.value ? 'dark' : '',
116+
a11y: {
117+
translations: {
118+
keyboardNavigation: $t('package.trends.chart_sr.keyboard_navigation_vertical'),
119+
tableAvailable: $t('package.trends.chart_sr.table_available'),
120+
tableCaption: $t('package.trends.chart_sr.table_caption')
121+
}
122+
},
116123
userOptions: {
117124
buttons: {
118125
tooltip: false,

app/components/Package/TrendsChart.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,13 @@ watch(
13881388
const chartConfig = computed<VueUiXyConfig>(() => {
13891389
return {
13901390
theme: isDarkMode.value ? 'dark' : ('' as VueDataUiTheme),
1391+
a11y: {
1392+
translations: {
1393+
keyboardNavigation: $t('package.trends.chart_sr.keyboard_navigation_horizontal'),
1394+
tableAvailable: $t('package.trends.chart_sr.table_available'),
1395+
tableCaption: $t('package.trends.chart_sr.table_caption')
1396+
}
1397+
},
13911398
chart: {
13921399
height: chartHeight.value,
13931400
backgroundColor: colors.value.bg,

app/components/Package/VersionDistribution.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ const hasMinimap = computed<boolean>(() => {
161161
const chartConfig = computed<VueUiXyConfig>(() => {
162162
return {
163163
theme: isDarkMode.value ? 'dark' : '',
164+
a11y: {
165+
translations: {
166+
keyboardNavigation: $t('package.trends.chart_sr.keyboard_navigation_horizontal'),
167+
tableAvailable: $t('package.trends.chart_sr.table_available'),
168+
tableCaption: $t('package.trends.chart_sr.table_caption')
169+
}
170+
},
164171
chart: {
165172
title: {
166173
text: dateRangeLabel.value,

app/components/Package/WeeklyDownloadStats.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,13 @@ function layEgg() {
313313
314314
const config = computed<VueUiSparklineConfig>(() => {
315315
return {
316+
a11y: {
317+
translations: {
318+
keyboardNavigation: $t('package.trends.chart_sr.keyboard_navigation_horizontal'),
319+
tableAvailable: $t('package.trends.chart_sr.table_available'),
320+
tableCaption: $t('package.trends.chart_sr.table_caption')
321+
}
322+
},
316323
theme: 'dark',
317324
/**
318325
* The built-in skeleton loader kicks in when the component is mounted but the data is not yet ready.

0 commit comments

Comments
 (0)