Skip to content

Commit 58277cf

Browse files
committed
fix: apply coderabbit suggestions
1 parent 036501a commit 58277cf

7 files changed

Lines changed: 18 additions & 7 deletions

File tree

app/utils/charts.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ export function computeLineChartAnalysis(values: Array<number | null>): LineChar
470470

471471
export type TrendLineDataset = {
472472
lines: VueUiXyDatasetLineItem[]
473-
[key: string]: any
473+
[key: string]: unknown
474474
} | null
475475

476476
export type TrendTranslateKey = number | 'package.trends.y_axis_label' | (string & {})
@@ -539,7 +539,10 @@ export function createAltTextForTrendLineChart({
539539
end_value: config.formattedDatasetValues[i]?.at(-1) ?? 0,
540540
trend: trendText,
541541
downloads_slope: config.numberFormatter(pkg.slope),
542-
growth_percentage: `${pkg.progressionPercent?.toFixed(1)}%`,
542+
growth_percentage:
543+
pkg.progressionPercent !== null
544+
? `${pkg.progressionPercent.toFixed(1)}%`
545+
: config.$t('package.trends.copy_alt.growth_unavailable'),
543546
})
544547
})
545548
.join(', ')

i18n/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@
387387
"estimations": "The final values are estimates based on partial data for the current period.",
388388
"compare": "Package download comparison line chart for: {packages}.",
389389
"single_package": "Downloads line chart for the {package} package.",
390-
"general_description": "The Y axis represents the number of downloads. The X axis represents the date range, from {start_date} to {end_date}, with a {granularity} time period.{estimation_notice} {packages_analysis}. {watermark}."
390+
"general_description": "The Y axis represents the number of downloads. The X axis represents the date range, from {start_date} to {end_date}, with a {granularity} time period.{estimation_notice} {packages_analysis}. {watermark}.",
391+
"growth_unavailable": "N/A"
391392
}
392393
},
393394
"downloads": {

i18n/locales/fr-FR.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@
387387
"estimations": "Les valeurs finales sont des estimations basées sur des données partielles pour la période en cours.",
388388
"compare": "Graphique en courbes comparant les téléchargements des paquets suivants : {packages}.",
389389
"single_package": "Graphique en courbes des téléchargements pour le paquet {package}.",
390-
"general_description": "L’axe Y représente le nombre de téléchargements. L’axe X représente la plage de dates, de {start_date} à {end_date}, avec une période de temps {granularity}.{estimation_notice} {packages_analysis}. {watermark}."
390+
"general_description": "L’axe Y représente le nombre de téléchargements. L’axe X représente la plage de dates, de {start_date} à {end_date}, avec une période de temps {granularity}.{estimation_notice} {packages_analysis}. {watermark}.",
391+
"growth_unavailable": "N/A"
391392
}
392393
},
393394
"downloads": {

i18n/schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,9 @@
11671167
},
11681168
"general_description": {
11691169
"type": "string"
1170+
},
1171+
"growth_unavailable": {
1172+
"type": "string"
11701173
}
11711174
},
11721175
"additionalProperties": false

lunaria/files/en-GB.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@
386386
"estimations": "The final values are estimates based on partial data for the current period.",
387387
"compare": "Package download comparison line chart for: {packages}.",
388388
"single_package": "Downloads line chart for the {package} package.",
389-
"general_description": "The Y axis represents the number of downloads. The X axis represents the date range, from {start_date} to {end_date}, with a {granularity} time period.{estimation_notice} {packages_analysis}. {watermark}."
389+
"general_description": "The Y axis represents the number of downloads. The X axis represents the date range, from {start_date} to {end_date}, with a {granularity} time period.{estimation_notice} {packages_analysis}. {watermark}.",
390+
"growth_unavailable": "N/A"
390391
}
391392
},
392393
"downloads": {

lunaria/files/en-US.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@
386386
"estimations": "The final values are estimates based on partial data for the current period.",
387387
"compare": "Package download comparison line chart for: {packages}.",
388388
"single_package": "Downloads line chart for the {package} package.",
389-
"general_description": "The Y axis represents the number of downloads. The X axis represents the date range, from {start_date} to {end_date}, with a {granularity} time period.{estimation_notice} {packages_analysis}. {watermark}."
389+
"general_description": "The Y axis represents the number of downloads. The X axis represents the date range, from {start_date} to {end_date}, with a {granularity} time period.{estimation_notice} {packages_analysis}. {watermark}.",
390+
"growth_unavailable": "N/A"
390391
}
391392
},
392393
"downloads": {

lunaria/files/fr-FR.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@
386386
"estimations": "Les valeurs finales sont des estimations basées sur des données partielles pour la période en cours.",
387387
"compare": "Graphique en courbes comparant les téléchargements des paquets suivants : {packages}.",
388388
"single_package": "Graphique en courbes des téléchargements pour le paquet {package}.",
389-
"general_description": "L’axe Y représente le nombre de téléchargements. L’axe X représente la plage de dates, de {start_date} à {end_date}, avec une période de temps {granularity}.{estimation_notice} {packages_analysis}. {watermark}."
389+
"general_description": "L’axe Y représente le nombre de téléchargements. L’axe X représente la plage de dates, de {start_date} à {end_date}, avec une période de temps {granularity}.{estimation_notice} {packages_analysis}. {watermark}.",
390+
"growth_unavailable": "N/A"
390391
}
391392
},
392393
"downloads": {

0 commit comments

Comments
 (0)