From abb12bac6b6724cdfb763e0ddcf70f5cfe4d2687 Mon Sep 17 00:00:00 2001 From: Jony J <1844749591@qq.com> Date: Fri, 7 Feb 2025 10:38:35 +0800 Subject: [PATCH] feat: improve a11y when table header is empty and add localization support (#904) * feat: improve a11y when table header is empty * feat: Add 'week' localization support across multiple locales * fix: Update Turkmen locale 'week' translation --- src/PickerPanel/DatePanel/index.tsx | 12 ++- src/PickerPanel/MonthPanel/index.tsx | 2 +- src/PickerPanel/PanelHeader.tsx | 8 +- src/PickerPanel/QuarterPanel/index.tsx | 2 +- src/PickerPanel/YearPanel/index.tsx | 2 +- src/interface.tsx | 1 + src/locale/am_ET.ts | 1 + src/locale/ar_EG.ts | 1 + src/locale/az_AZ.ts | 1 + src/locale/bg_BG.ts | 1 + src/locale/bn_BD.ts | 1 + src/locale/by_BY.ts | 1 + src/locale/ca_ES.ts | 1 + src/locale/cs_CZ.ts | 1 + src/locale/da_DK.ts | 1 + src/locale/de_DE.ts | 1 + src/locale/el_GR.ts | 1 + src/locale/en_GB.ts | 1 + src/locale/en_US.ts | 1 + src/locale/es_ES.ts | 1 + src/locale/es_MX.ts | 1 + src/locale/et_EE.ts | 1 + src/locale/eu_ES.ts | 1 + src/locale/fa_IR.ts | 1 + src/locale/fi_FI.ts | 1 + src/locale/fr_BE.ts | 1 + src/locale/fr_CA.ts | 1 + src/locale/fr_FR.ts | 1 + src/locale/ga_IE.ts | 1 + src/locale/gl_ES.ts | 1 + src/locale/he_IL.ts | 1 + src/locale/hi_IN.ts | 1 + src/locale/hr_HR.ts | 1 + src/locale/hu_HU.ts | 1 + src/locale/id_ID.ts | 1 + src/locale/is_IS.ts | 1 + src/locale/it_IT.ts | 1 + src/locale/ja_JP.ts | 1 + src/locale/ka_GE.ts | 1 + src/locale/kk_KZ.ts | 1 + src/locale/km_KH.ts | 1 + src/locale/kmr_IQ.ts | 1 + src/locale/kn_IN.ts | 1 + src/locale/ko_KR.ts | 1 + src/locale/lt_LT.ts | 1 + src/locale/lv_LV.ts | 1 + src/locale/mk_MK.ts | 1 + src/locale/ml_IN.ts | 1 + src/locale/mn_MN.ts | 1 + src/locale/ms_MY.ts | 1 + src/locale/my_MM.ts | 1 + src/locale/nb_NO.ts | 1 + src/locale/ne_NP.ts | 1 + src/locale/nl_BE.ts | 1 + src/locale/nl_NL.ts | 1 + src/locale/pl_PL.ts | 1 + src/locale/pt_BR.ts | 1 + src/locale/pt_PT.ts | 1 + src/locale/ro_RO.ts | 1 + src/locale/ru_RU.ts | 1 + src/locale/si_LK.ts | 1 + src/locale/sk_SK.ts | 1 + src/locale/sl_SI.ts | 1 + src/locale/sr_Cyrl_RS.ts | 1 + src/locale/sr_RS.ts | 1 + src/locale/sv_SE.ts | 1 + src/locale/ta_IN.ts | 1 + src/locale/th_TH.ts | 1 + src/locale/tk_TK.ts | 1 + src/locale/tr_TR.ts | 1 + src/locale/ug_CN.ts | 1 + src/locale/uk_UA.ts | 1 + src/locale/ur_PK.ts | 1 + src/locale/uz_UZ.ts | 1 + src/locale/vi_VN.ts | 1 + src/locale/zh_CN.ts | 1 + src/locale/zh_TW.ts | 1 + tests/__snapshots__/panel.spec.tsx.snap | 136 +++++++++++++----------- tests/__snapshots__/range.spec.tsx.snap | 36 +++---- 79 files changed, 178 insertions(+), 92 deletions(-) diff --git a/src/PickerPanel/DatePanel/index.tsx b/src/PickerPanel/DatePanel/index.tsx index 4a6f387c3..e4bbe6595 100644 --- a/src/PickerPanel/DatePanel/index.tsx +++ b/src/PickerPanel/DatePanel/index.tsx @@ -98,7 +98,13 @@ export default function DatePanel(props: DatePane : []); if (prefixColumn) { - headerCells.push(); + headerCells.push( + + + {locale.week} + + , + ); } for (let i = 0; i < WEEK_DAY_COUNT; i += 1) { headerCells.push({weekDaysLocale[(i + weekFirstDay) % WEEK_DAY_COUNT]}); @@ -136,7 +142,7 @@ export default function DatePanel(props: DatePane const yearNode: React.ReactNode = (