Skip to content

Commit 35cb589

Browse files
authored
chore: Minor changes to the i18n APIs (#56)
* chore: Minor changes to the i18n APIs * minor api description change
1 parent 5c9876d commit 35cb589

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

src/__tests__/__snapshots__/documenter.test.ts.snap

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Supported Highcharts versions: 12.",
133133
"name": "CartesianI18nStrings",
134134
"properties": [
135135
{
136-
"name": "chartAccessibleDescription",
136+
"name": "chartRoleDescription",
137137
"optional": true,
138138
"type": "string",
139139
},
@@ -178,12 +178,12 @@ Supported Highcharts versions: 12.",
178178
"type": "string",
179179
},
180180
{
181-
"name": "xAxisAccessibleDescription",
181+
"name": "xAxisRoleDescription",
182182
"optional": true,
183183
"type": "string",
184184
},
185185
{
186-
"name": "yAxisAccessibleDescription",
186+
"name": "yAxisRoleDescription",
187187
"optional": true,
188188
"type": "string",
189189
},
@@ -313,7 +313,7 @@ This property corresponds to "normal" stacking type in Highcharts ([plotOptions.
313313
},
314314
{
315315
"description": "Defines tooltip options of the chart, including:
316-
* \`enabled\` - (optional, boolean) - Hides the tooltip.
316+
* \`enabled\` - (optional, boolean) - Hides the tooltip when set to false.
317317
* \`size\` - (optional, "small" | "medium" | "large") - Specifies max tooltip size.
318318
* \`placement\` - (optional, "middle" | "outside") - Specifies preferred tooltip placement.
319319
* \`point\` - (optional, function) - Customizes tooltip series point rendering.
@@ -658,7 +658,7 @@ Supported Highcharts versions: 12.",
658658
"name": "PieI18nStrings",
659659
"properties": [
660660
{
661-
"name": "chartAccessibleDescription",
661+
"name": "chartRoleDescription",
662662
"optional": true,
663663
"type": "string",
664664
},
@@ -688,7 +688,7 @@ Supported Highcharts versions: 12.",
688688
"type": "string",
689689
},
690690
{
691-
"name": "segmentAccessibleDescription",
691+
"name": "segmentRoleDescription",
692692
"optional": true,
693693
"type": "string",
694694
},
@@ -866,7 +866,7 @@ Supported series types:
866866
},
867867
{
868868
"description": "Defines tooltip options of the chart, including:
869-
* \`enabled\` - (optional, boolean) - Hides the tooltip.
869+
* \`enabled\` - (optional, boolean) - Hides the tooltip when set to false.
870870
* \`size\` - (optional, "small" | "medium" | "large") - Specifies max tooltip size.
871871
* \`details\` - (optional, function) - Provides a list of key-value pairs as tooltip's body.
872872
* \`header\` - (optional, function) - Renders a custom tooltip header.

src/cartesian-chart/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export interface CartesianChartProps
4343

4444
/**
4545
* Defines tooltip options of the chart, including:
46-
* * `enabled` - (optional, boolean) - Hides the tooltip.
46+
* * `enabled` - (optional, boolean) - Hides the tooltip when set to false.
4747
* * `size` - (optional, "small" | "medium" | "large") - Specifies max tooltip size.
4848
* * `placement` - (optional, "middle" | "outside") - Specifies preferred tooltip placement.
4949
* * `point` - (optional, function) - Customizes tooltip series point rendering.

src/core/i18n-utils.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export function useChartI18n({
3030
chartDescription: ariaDescription,
3131
// We reuse existing translations as passing for now, but it is possible to introduce new i18n strings that
3232
// are parametrized with axes names, and more.
33-
chartContainerLabel: i18n("i18nStrings.chartAriaRoleDescription", i18nStrings?.chartAccessibleDescription),
34-
chartXAxisLabel: i18n("i18nStrings.xAxisAriaRoleDescription", i18nStrings?.xAxisAccessibleDescription),
35-
chartYAxisLabel: i18n("i18nStrings.yAxisAriaRoleDescription", i18nStrings?.yAxisAccessibleDescription),
36-
chartSegmentLabel: i18nPie("i18nStrings.segmentAriaRoleDescription", i18nStrings?.segmentAccessibleDescription),
33+
chartContainerLabel: i18n("i18nStrings.chartAriaRoleDescription", i18nStrings?.chartRoleDescription),
34+
chartXAxisLabel: i18n("i18nStrings.xAxisAriaRoleDescription", i18nStrings?.xAxisRoleDescription),
35+
chartYAxisLabel: i18n("i18nStrings.yAxisAriaRoleDescription", i18nStrings?.yAxisRoleDescription),
36+
chartSegmentLabel: i18nPie("i18nStrings.segmentAriaRoleDescription", i18nStrings?.segmentRoleDescription),
3737
};
3838
}

src/core/interfaces.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export interface BaseI18nStrings {
117117
seriesFilterSelectedAriaLabel?: string;
118118
legendAriaLabel?: string;
119119
detailPopoverDismissAriaLabel?: string;
120-
chartAccessibleDescription?: string;
120+
chartRoleDescription?: string;
121121
}
122122

123123
export interface WithCartesianI18nStrings {
@@ -134,9 +134,9 @@ export interface WithCartesianI18nStrings {
134134
* * `seriesFilterSelectedAriaLabel` (optional, string) - ARIA label of the default series filter which is appended to any option that is selected.
135135
* * `legendAriaLabel` (optional, string) - ARIA label that is associated with the legend in case there is no visible `legend.title` defined.
136136
* * `detailPopoverDismissAriaLabel` (optional, string) - ARIA label for the details popover dismiss button.
137-
* * `chartAccessibleDescription` (optional, string) - Accessible description of the chart plot area, e.g. "interactive chart".
138-
* * `xAxisAccessibleDescription` (optional, string) - Accessible description of the x axis, e.g. "x axis".
139-
* * `yAxisAccessibleDescription` (optional, string) - Accessible description of the y axis, e.g. "y axis".
137+
* * `chartRoleDescription` (optional, string) - Accessible role description of the chart plot area, e.g. "interactive chart".
138+
* * `xAxisRoleDescription` (optional, string) - Accessible role description of the x axis, e.g. "x axis".
139+
* * `yAxisRoleDescription` (optional, string) - Accessible role description of the y axis, e.g. "y axis".
140140
*/
141141
i18nStrings?: CartesianI18nStrings;
142142
}
@@ -155,19 +155,19 @@ export interface WithPieI18nStrings {
155155
* * `seriesFilterSelectedAriaLabel` (optional, string) - ARIA label of the default series filter which is appended to any option that is selected.
156156
* * `legendAriaLabel` (optional, string) - ARIA label that is associated with the legend in case there is no visible `legend.title` defined.
157157
* * `detailPopoverDismissAriaLabel` (optional, string) - ARIA label for the details popover dismiss button.
158-
* * `chartAccessibleDescription` (optional, string) - Accessible description of the chart plot area, e.g. "interactive chart".
159-
* * `segmentAccessibleDescription` (optional, string) - Accessible description of the segment.
158+
* * `chartRoleDescription` (optional, string) - Accessible role description of the chart plot area, e.g. "interactive chart".
159+
* * `segmentRoleDescription` (optional, string) - Accessible role description of the segment.
160160
*/
161161
i18nStrings?: PieI18nStrings;
162162
}
163163

164164
export interface CartesianI18nStrings extends BaseI18nStrings {
165-
xAxisAccessibleDescription?: string;
166-
yAxisAccessibleDescription?: string;
165+
xAxisRoleDescription?: string;
166+
yAxisRoleDescription?: string;
167167
}
168168

169169
export interface PieI18nStrings extends BaseI18nStrings {
170-
segmentAccessibleDescription?: string;
170+
segmentRoleDescription?: string;
171171
}
172172

173173
export interface BaseFilterOptions {

src/pie-chart/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface PieChartProps extends CoreTypes.BaseChartOptions, CoreTypes.Wit
2121

2222
/**
2323
* Defines tooltip options of the chart, including:
24-
* * `enabled` - (optional, boolean) - Hides the tooltip.
24+
* * `enabled` - (optional, boolean) - Hides the tooltip when set to false.
2525
* * `size` - (optional, "small" | "medium" | "large") - Specifies max tooltip size.
2626
* * `details` - (optional, function) - Provides a list of key-value pairs as tooltip's body.
2727
* * `header` - (optional, function) - Renders a custom tooltip header.

0 commit comments

Comments
 (0)