Skip to content

Commit a512045

Browse files
benelanjcfranco
andcommitted
refactor(i18n)!: reduce list of supported numbering systems (#8217)
**Related Issue:** #8216 ## Summary Reduce the list of supported numbering systems to `arab`, `arabext`, and `latn` after a discussion in the Internationalization Teams channel. BREAKING CHANGE: Removed support for the following numbering systems: `bali`, `beng`, `deva`, `fullwide`, `gujr`, `guru`, `hanidec`, `khmr`, `knda`, `laoo`, `limb`, `mlym`, `mong`, `mymr`, `orya`, `tamldec`, `telu`, `thai`, `tibt` --------- Co-authored-by: JC Franco <[email protected]>
1 parent dee36eb commit a512045

File tree

10 files changed

+24
-118
lines changed

10 files changed

+24
-118
lines changed

packages/calcite-components/src/components/date-picker/date-picker.stories.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -241,17 +241,6 @@ arabLangNumberingSystem_TestOnly.parameters = {
241241
chromatic: { diffThreshold: 1 },
242242
};
243243

244-
export const thaiLangNumberingSystem_TestOnly = (): string =>
245-
html`<div style="width: 400px">
246-
${create(
247-
"calcite-date-picker",
248-
createAttributes({ exceptions: ["lang", "numberingSystem"] }).concat([
249-
{ name: "lang", value: "th" },
250-
{ name: "numbering-system", value: "thai" },
251-
])
252-
)}
253-
</div>`;
254-
255244
export const widthSetToBreakpoints_TestOnly = (): string =>
256245
createBreakpointStories(html`<calcite-date-picker scale="{scale}" value="2000-11-27"></calcite-date-picker>`);
257246

packages/calcite-components/src/components/input-date-picker/input-date-picker.stories.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,12 @@ export const flipPlacements_TestOnly = (): string => html`
6666
</script>
6767
`;
6868

69-
export const laoNumberingSystemAndMediumIconForLargeInput_TestOnly = (): string => html`
69+
export const mediumIconForLargeInput_TestOnly = (): string => html`
7070
<div style="width: 400px">
7171
<calcite-input-date-picker
7272
open
7373
value="1/1/1"
7474
lang="zh-CN"
75-
numbering-system="laoo"
7675
scale="l"
7776
start="2020-12-12"
7877
end="2020-12-16"

packages/calcite-components/src/components/input-number/input-number.stories.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -115,34 +115,20 @@ export const darkModeRTL_TestOnly = (): string => html`
115115
`;
116116
darkModeRTL_TestOnly.parameters = { modes: modesDarkDefault };
117117

118-
export const hebrewNumberingSystemAndMediumIconForLargeInputStyling_TestOnly = (): string =>
118+
export const mediumIconForLargeInputStyling_TestOnly = (): string =>
119119
html`
120-
<calcite-input-number
121-
number-button-type="vertical"
122-
lang="ar-EG"
123-
numbering-system="hebr"
124-
value="123456"
125-
scale="l"
126-
></calcite-input-number
120+
<calcite-input-number number-button-type="vertical" lang="ar-EG" value="123456" scale="l"></calcite-input-number
127121
><calcite-input-number
128122
number-button-type="vertical"
129123
lang="ar-EG"
130-
numbering-system="hebr"
131124
value="123456"
132125
scale="l"
133126
icon="pen"
134127
></calcite-input-number>
135-
<calcite-input-number
136-
number-button-type="horizontal"
137-
lang="ar-EG"
138-
numbering-system="hebr"
139-
value="123456"
140-
scale="l"
141-
></calcite-input-number
128+
<calcite-input-number number-button-type="horizontal" lang="ar-EG" value="123456" scale="l"></calcite-input-number
142129
><calcite-input-number
143130
number-button-type="horizontal"
144131
lang="ar-EG"
145-
numbering-system="hebr"
146132
value="123456"
147133
scale="l"
148134
icon="pen"

packages/calcite-components/src/components/input-time-picker/input-time-picker.e2e.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ describe("calcite-input-time-picker", () => {
225225
expect(inputTimePickerValue).toBe(expectedValue);
226226
});
227227

228-
it("value displays correctly in the input when it is directly changed for a 24-hour language when a default value is present (thai lang/numberingSystem)", async () => {
229-
const locale = "th";
230-
const numberingSystem = "thai";
228+
it("value displays correctly in the input when it is directly changed for a 24-hour language when a default value is present (arab lang/numberingSystem)", async () => {
229+
const locale = "ar";
230+
const numberingSystem = "arab";
231231
const initialValue = "11:00:00";
232232

233233
const page = await newE2EPage();
@@ -665,11 +665,11 @@ describe("calcite-input-time-picker", () => {
665665
expect(await getInputValue(page)).toBe("٠٢:٣٠:٢٥ م");
666666

667667
inputTimePicker.setProperty("lang", "zh-HK");
668-
inputTimePicker.setProperty("numberingSystem", "hanidec");
668+
inputTimePicker.setProperty("numberingSystem", "latn");
669669
await page.waitForChanges();
670670
await waitForAnimationFrame();
671671

672-
expect(await getInputValue(page)).toBe("下午〇二:三〇:二五");
672+
expect(await getInputValue(page)).toBe("下午02:30");
673673
});
674674

675675
describe("arabic locale support", () => {

packages/calcite-components/src/components/input/input.stories.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,6 @@ export const darkModeRTL_TestOnly = (): string => html`
155155
`;
156156
darkModeRTL_TestOnly.parameters = { modes: modesDarkDefault };
157157

158-
export const hebrewNumberingSystem_TestOnly = (): string =>
159-
html` <calcite-input type="number" lang="ar-EG" numbering-system="hebr" value="123456"></calcite-input>`;
160-
161158
export const arabicLocaleWithLatinNumberingSystem_TestOnly = (): string =>
162159
html` <calcite-input type="number" lang="ar-EG" value="123456"></calcite-input>`;
163160

packages/calcite-components/src/components/stepper/stepper.e2e.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -668,13 +668,16 @@ describe("calcite-stepper", () => {
668668
const stepper1Number = await page.find("calcite-stepper-item[id='step-one'] >>> .stepper-item-number");
669669
expect(stepper1Number.textContent).toBe("1.");
670670

671-
stepper2.setProperty("numberingSystem", "thai");
671+
stepper2.setProperty("numberingSystem", "arabext");
672672
await page.waitForChanges();
673+
673674
const stepper2Number = await page.find("calcite-stepper-item[id='step-two'] >>> .stepper-item-number");
674-
const thaiNumeral1 = new Intl.NumberFormat("th", { numberingSystem: "thai" } as NumberStringFormatOptions).format(
675-
1
676-
);
677-
expect(stepper2Number.textContent).toBe(`${thaiNumeral1}.`);
675+
676+
const arabextNumeral1 = new Intl.NumberFormat("ar", {
677+
numberingSystem: "arabext",
678+
} as NumberStringFormatOptions).format(1);
679+
680+
expect(stepper2Number.textContent).toBe(`${arabextNumeral1}.`);
678681
});
679682

680683
it("should have correct ARIA attributes", async () => {

packages/calcite-components/src/components/text-area/text-area.stories.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,8 @@ export const exceedingMaxLength_TestOnly = (): string => html`
7070
<calcite-text-area value="Rocky Mountains National Park" max-length="10"> </calcite-text-area>
7171
`;
7272

73-
export const chineseLangNumberingSystem_TestOnly = (): string => html`
74-
<calcite-text-area
75-
value="Rocky Mountains National Park"
76-
lang="zh-cn"
77-
numbering-system="hanidec"
78-
group-separator
79-
max-length="654321"
80-
>
73+
export const chineseLang_TestOnly = (): string => html`
74+
<calcite-text-area value="Rocky Mountains National Park" lang="zh-cn" group-separator max-length="654321">
8175
</calcite-text-area>
8276
`;
8377

packages/calcite-components/src/demos/_assets/locales.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ export const locales: Locale[] = [
208208
{
209209
name: "Thai (Thai digits)",
210210
locale: "th",
211-
numberingSystem: "thai",
212211
},
213212
{
214213
name: "Turkish",
@@ -226,27 +225,12 @@ export const locales: Locale[] = [
226225
name: "Chinese (China)",
227226
locale: "zh-CN",
228227
},
229-
{
230-
name: "Chinese (China) (Hanidec numerals)",
231-
locale: "zh-CN",
232-
numberingSystem: "hanidec",
233-
},
234228
{
235229
name: "Chinese (Hong Kong)",
236230
locale: "zh-HK",
237231
},
238-
{
239-
name: "Chinese (Hong Kong) (Hanidec numerals)",
240-
locale: "zh-HK",
241-
numberingSystem: "hanidec",
242-
},
243232
{
244233
name: "Chinese (Taiwan)",
245234
locale: "zh-TW",
246235
},
247-
{
248-
name: "Chinese (Taiwan) (Hanidec numerals)",
249-
locale: "zh-TW",
250-
numberingSystem: "hanidec",
251-
},
252236
];

packages/calcite-components/src/demos/date-picker.html

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -218,33 +218,10 @@ <h1 style="margin: 0 auto; text-align: center">Date-picker</h1>
218218
<script type="module">
219219
import { locales } from "./_assets/locales.js";
220220

221-
const numberingSystems = [
222-
"arab",
223-
"arabext",
224-
"bali",
225-
"beng",
226-
"deva",
227-
"fullwide",
228-
"gujr",
229-
"guru",
230-
"hanidec",
231-
"khmr",
232-
"knda",
233-
"laoo",
234-
"latn",
235-
"limb",
236-
"mlym",
237-
"mong",
238-
"mymr",
239-
"orya",
240-
"tamldec",
241-
"telu",
242-
"thai",
243-
"tibt",
244-
];
245-
246-
let selectedLang = "th";
247-
let selectedNumberingSystem = "thai";
221+
const numberingSystems = ["arab", "arabext", "latn"];
222+
223+
let selectedLang = "ar";
224+
let selectedNumberingSystem = "arab";
248225

249226
let localeDatePickerS;
250227
let localeDatePickerL;

packages/calcite-components/src/utils/locale.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -100,30 +100,7 @@ export const locales = [
100100
"zh-TW",
101101
];
102102

103-
export const numberingSystems = [
104-
"arab",
105-
"arabext",
106-
"bali",
107-
"beng",
108-
"deva",
109-
"fullwide",
110-
"gujr",
111-
"guru",
112-
"hanidec",
113-
"khmr",
114-
"knda",
115-
"laoo",
116-
"latn",
117-
"limb",
118-
"mlym",
119-
"mong",
120-
"mymr",
121-
"orya",
122-
"tamldec",
123-
"telu",
124-
"thai",
125-
"tibt",
126-
] as const;
103+
export const numberingSystems = ["arab", "arabext", "latn"] as const;
127104

128105
export const supportedLocales = [...new Set([...t9nLocales, ...locales])] as const;
129106

0 commit comments

Comments
 (0)