From 2af292bd6468e9202150e20422a04d30388a666f Mon Sep 17 00:00:00 2001 From: Gio Cettuzzi Date: Thu, 18 Jun 2026 06:28:06 +0200 Subject: [PATCH] fix(date-picker): add missing locale file and fix let-to-const lint error - Add missing common.datepicker.* keys to overlooked locale file - Change reassigned `let` to `const` where value is not mutated to satisfy lint rules --- .../src/components/shared/CustomDateTimePicker.tsx | 4 ++-- shared/src/i18n/ja/common.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/client/src/components/shared/CustomDateTimePicker.tsx b/client/src/components/shared/CustomDateTimePicker.tsx index a4df951b9..b0d8ca7b6 100644 --- a/client/src/components/shared/CustomDateTimePicker.tsx +++ b/client/src/components/shared/CustomDateTimePicker.tsx @@ -206,8 +206,8 @@ export function CustomDatePicker({ // nachher: const get = (field: 'day' | 'month' | 'year') => parseInt(nums[order.indexOf(field)]); let d = get('day'), - m = get('month'), - y = get('year'); + m = get('month'); + const y = get('year'); if (isNaN(d) || isNaN(m) || isNaN(y)) return; // If locale order gives impossible month but valid swap, correct it diff --git a/shared/src/i18n/ja/common.ts b/shared/src/i18n/ja/common.ts index 9990f175c..b43a50a0b 100644 --- a/shared/src/i18n/ja/common.ts +++ b/shared/src/i18n/ja/common.ts @@ -50,5 +50,17 @@ const common: TranslationStrings = { 'common.collapse': '折りたたむ', 'common.copy': 'コピー', 'common.copied': 'コピーしました', + 'common.datepicker.prevMonth': 'Previous month', // en-fallback + 'common.datepicker.nextMonth': 'Next month', // en-fallback + 'common.datepicker.prevYear': 'Previous year', // en-fallback + 'common.datepicker.nextYear': 'Next year', // en-fallback + 'common.datepicker.prevYears': 'Previous years', // en-fallback + 'common.datepicker.nextYears': 'Next years', // en-fallback + 'common.datepicker.selectMonth': 'Select month', // en-fallback + 'common.datepicker.selectYear': 'Select year', // en-fallback + 'common.datepicker.enterManually': 'Enter date manually', // en-fallback + 'common.datepicker.typeDate': 'Type a date', // en-fallback + 'common.datepicker.dialog': 'Date picker', // en-fallback + 'common.datepicker.clearDate': 'Clear date', // en-fallback }; export default common;