@@ -627,7 +627,6 @@ export function useCharts() {
627627 dataset,
628628 config,
629629 } : AltCopyArgs < TrendLineDataset , TrendLineConfig > ) : string {
630- const { t } = useI18n ( )
631630 if ( ! dataset ) return ''
632631
633632 const analysis = dataset . lines . map ( ( { name, series } ) => ( {
@@ -637,15 +636,17 @@ export function useCharts() {
637636 hasEstimation : config . hasEstimation ,
638637 } ) )
639638
640- const granularity = t ( `package.trends.granularity_${ config . granularity } ` ) . toLocaleLowerCase ( )
639+ const granularity = config
640+ . $t ( `package.trends.granularity_${ config . granularity } ` )
641+ . toLocaleLowerCase ( )
641642
642643 const packages_analysis = analysis
643644 . map ( ( pkg , i ) =>
644- t ( `package.trends.copy_alt.analysis` , {
645+ config . $ t( `package.trends.copy_alt.analysis` , {
645646 package_name : pkg . name ,
646647 start_value : config . formattedDatasetValues [ i ] ?. [ 0 ] ?? 0 ,
647648 end_value : config . formattedDatasetValues [ i ] ?. at ( - 1 ) ?? 0 ,
648- trend : t ( `package.trends.copy_alt.trend_${ pkg . interpretation . trend } ` ) ,
649+ trend : config . $ t( `package.trends.copy_alt.trend_${ pkg . interpretation . trend } ` ) ,
649650 downloads_slope : compactNumberFormatter . value . format ( pkg . slope ) ,
650651 growth_percentage : `${ pkg . progressionPercent ?. toFixed ( 1 ) } %` ,
651652 } ) ,
@@ -655,18 +656,18 @@ export function useCharts() {
655656 const isSinglePackage = analysis . length === 1
656657
657658 const estimation_notice = config . hasEstimation
658- ? ` ${ isSinglePackage ? t ( 'package.trends.copy_alt.estimation' ) : t ( 'package.trends.copy_alt.estimations' ) } `
659+ ? ` ${ isSinglePackage ? config . $ t( 'package.trends.copy_alt.estimation' ) : config . $ t( 'package.trends.copy_alt.estimations' ) } `
659660 : ''
660661
661662 // Packages comparison
662- const compareText = `${ t ( 'package.trends.copy_alt.compare' , { packages : analysis . map ( a => a . name ) . join ( ', ' ) } ) } `
663- const singlePackageText = `${ t ( 'package.trends.copy_alt.single_package' , { package : analysis ?. [ 0 ] ?. name ?? '' } ) } `
664- const generalAnalysis = t ( `package.trends.copy_alt.general_description` , {
663+ const compareText = `${ config . $ t( 'package.trends.copy_alt.compare' , { packages : analysis . map ( a => a . name ) . join ( ', ' ) } ) } `
664+ const singlePackageText = `${ config . $ t( 'package.trends.copy_alt.single_package' , { package : analysis ?. [ 0 ] ?. name ?? '' } ) } `
665+ const generalAnalysis = config . $ t( `package.trends.copy_alt.general_description` , {
665666 start_date : analysis ?. [ 0 ] ?. dates [ 0 ] ?. text ,
666667 end_date : analysis ?. [ 0 ] ?. dates . at ( - 1 ) ?. text ,
667668 granularity,
668669 packages_analysis,
669- watermark : t ( 'package.trends.copy_alt.watermark' ) ,
670+ watermark : config . $ t( 'package.trends.copy_alt.watermark' ) ,
670671 estimation_notice,
671672 } )
672673
0 commit comments