From e59a9818a9d71d0060add8d99c87364b428a94ae Mon Sep 17 00:00:00 2001 From: Ulas Kalayci Date: Thu, 30 Apr 2026 19:54:12 +0200 Subject: [PATCH] fix(i18n): add time format translations to all 13 missing locales Also translate server error message to English and remove stale comment from calendar.js catch block. Co-Authored-By: Claude Sonnet 4.6 --- public/locales/ar.json | 3 +++ public/locales/el.json | 3 +++ public/locales/es.json | 3 +++ public/locales/fr.json | 3 +++ public/locales/hi.json | 3 +++ public/locales/it.json | 3 +++ public/locales/ja.json | 3 +++ public/locales/pt.json | 3 +++ public/locales/ru.json | 3 +++ public/locales/sv.json | 3 +++ public/locales/tr.json | 3 +++ public/locales/uk.json | 3 +++ public/locales/zh.json | 3 +++ public/pages/calendar.js | 4 +--- server/routes/preferences.js | 2 +- 15 files changed, 41 insertions(+), 4 deletions(-) diff --git a/public/locales/ar.json b/public/locales/ar.json index 9dc25ef..e247dd4 100644 --- a/public/locales/ar.json +++ b/public/locales/ar.json @@ -607,6 +607,9 @@ "dateFormatLabel": "تنسيق التاريخ المفضل", "dateFormatHint": "اختر كيف تظهر التواريخ في التطبيق.", "dateFormatSavedToast": "تم حفظ تنسيق التاريخ.", + "timeFormatLabel": "تنسيق الوقت", + "timeFormatHours": "ساعة", + "timeFormatSavedToast": "تم حفظ تنسيق الوقت.", "themeSystem": "النظام", "themeSysLabel": "استخدام إعداد النظام", "themeLight": "فاتح", diff --git a/public/locales/el.json b/public/locales/el.json index 3cd0e17..e3230bb 100644 --- a/public/locales/el.json +++ b/public/locales/el.json @@ -607,6 +607,9 @@ "dateFormatLabel": "Προτιμώμενη μορφή ημερομηνίας", "dateFormatHint": "Επιλέξτε πώς εμφανίζονται οι ημερομηνίες στην εφαρμογή.", "dateFormatSavedToast": "Η μορφή ημερομηνίας αποθηκεύτηκε.", + "timeFormatLabel": "Μορφή ώρας", + "timeFormatHours": "ώρες", + "timeFormatSavedToast": "Η μορφή ώρας αποθηκεύτηκε.", "themeSystem": "Σύστημα", "themeSysLabel": "Χρήση ρύθμισης συστήματος", "themeLight": "Ανοιχτό", diff --git a/public/locales/es.json b/public/locales/es.json index 5410d31..6c4ca09 100644 --- a/public/locales/es.json +++ b/public/locales/es.json @@ -607,6 +607,9 @@ "dateFormatLabel": "Formato de fecha preferido", "dateFormatHint": "Elige cómo se muestran las fechas en toda la app.", "dateFormatSavedToast": "Formato de fecha guardado.", + "timeFormatLabel": "Formato de hora", + "timeFormatHours": "horas", + "timeFormatSavedToast": "Formato de hora guardado.", "themeSystem": "Sistema", "themeSysLabel": "Usar configuración del sistema", "themeLight": "Claro", diff --git a/public/locales/fr.json b/public/locales/fr.json index 9641f44..d804651 100644 --- a/public/locales/fr.json +++ b/public/locales/fr.json @@ -607,6 +607,9 @@ "dateFormatLabel": "Format de date préféré", "dateFormatHint": "Choisissez comment les dates sont affichées dans l'application.", "dateFormatSavedToast": "Format de date enregistré.", + "timeFormatLabel": "Format de l'heure", + "timeFormatHours": "heures", + "timeFormatSavedToast": "Format de l'heure enregistré.", "themeSystem": "Système", "themeSysLabel": "Utiliser le paramètre système", "themeLight": "Clair", diff --git a/public/locales/hi.json b/public/locales/hi.json index e64aa80..028f1a1 100644 --- a/public/locales/hi.json +++ b/public/locales/hi.json @@ -607,6 +607,9 @@ "dateFormatLabel": "पसंदीदा तारीख प्रारूप", "dateFormatHint": "चुनें कि ऐप में तारीखें कैसे दिखाई दें।", "dateFormatSavedToast": "तारीख प्रारूप सहेजा गया।", + "timeFormatLabel": "समय प्रारूप", + "timeFormatHours": "घंटे", + "timeFormatSavedToast": "समय प्रारूप सहेजा गया।", "themeSystem": "सिस्टम", "themeSysLabel": "सिस्टम सेटिंग का उपयोग करें", "themeLight": "हल्का", diff --git a/public/locales/it.json b/public/locales/it.json index 4bb0782..f8dceed 100644 --- a/public/locales/it.json +++ b/public/locales/it.json @@ -607,6 +607,9 @@ "dateFormatLabel": "Formato data preferito", "dateFormatHint": "Scegli come vengono mostrate le date nell'app.", "dateFormatSavedToast": "Formato data salvato.", + "timeFormatLabel": "Formato orario", + "timeFormatHours": "ore", + "timeFormatSavedToast": "Formato orario salvato.", "themeSystem": "Sistema", "themeSysLabel": "Usa impostazione di sistema", "themeLight": "Chiaro", diff --git a/public/locales/ja.json b/public/locales/ja.json index 2dc64a4..fa047db 100644 --- a/public/locales/ja.json +++ b/public/locales/ja.json @@ -607,6 +607,9 @@ "dateFormatLabel": "希望する日付形式", "dateFormatHint": "アプリ内で日付をどう表示するかを選択します。", "dateFormatSavedToast": "日付形式を保存しました。", + "timeFormatLabel": "時刻形式", + "timeFormatHours": "時間", + "timeFormatSavedToast": "時刻形式を保存しました。", "themeSystem": "システム設定", "themeSysLabel": "システム設定を使用", "themeLight": "ライト", diff --git a/public/locales/pt.json b/public/locales/pt.json index 612b633..32b1e7f 100644 --- a/public/locales/pt.json +++ b/public/locales/pt.json @@ -607,6 +607,9 @@ "dateFormatLabel": "Formato preferido da data", "dateFormatHint": "Escolha como as datas aparecem em toda a aplicação.", "dateFormatSavedToast": "Formato da data salvo.", + "timeFormatLabel": "Formato de hora", + "timeFormatHours": "horas", + "timeFormatSavedToast": "Formato de hora salvo.", "themeSystem": "Sistema", "themeSysLabel": "Usar configuração do sistema", "themeLight": "Claro", diff --git a/public/locales/ru.json b/public/locales/ru.json index 60e5983..8de0150 100644 --- a/public/locales/ru.json +++ b/public/locales/ru.json @@ -607,6 +607,9 @@ "dateFormatLabel": "Предпочитаемый формат даты", "dateFormatHint": "Выберите, как даты отображаются в приложении.", "dateFormatSavedToast": "Формат даты сохранён.", + "timeFormatLabel": "Формат времени", + "timeFormatHours": "часов", + "timeFormatSavedToast": "Формат времени сохранён.", "themeSystem": "Система", "themeSysLabel": "Использовать системную настройку", "themeLight": "Светлая", diff --git a/public/locales/sv.json b/public/locales/sv.json index 27b17e5..37a2198 100644 --- a/public/locales/sv.json +++ b/public/locales/sv.json @@ -607,6 +607,9 @@ "dateFormatLabel": "Önskat datumformat", "dateFormatHint": "Välj hur datum visas i appen.", "dateFormatSavedToast": "Datumformat sparat.", + "timeFormatLabel": "Tidsformat", + "timeFormatHours": "timmar", + "timeFormatSavedToast": "Tidsformat sparat.", "themeSystem": "System", "themeSysLabel": "Använd systeminställning", "themeLight": "Ljus", diff --git a/public/locales/tr.json b/public/locales/tr.json index 8cda108..e0e9dbd 100644 --- a/public/locales/tr.json +++ b/public/locales/tr.json @@ -607,6 +607,9 @@ "dateFormatLabel": "Tercih edilen tarih biçimi", "dateFormatHint": "Tarihlerin uygulamada nasıl görüneceğini seçin.", "dateFormatSavedToast": "Tarih biçimi kaydedildi.", + "timeFormatLabel": "Saat biçimi", + "timeFormatHours": "saat", + "timeFormatSavedToast": "Saat biçimi kaydedildi.", "themeSystem": "Sistem", "themeSysLabel": "Sistem ayarını kullan", "themeLight": "Açık", diff --git a/public/locales/uk.json b/public/locales/uk.json index 272cde9..7d97282 100644 --- a/public/locales/uk.json +++ b/public/locales/uk.json @@ -607,6 +607,9 @@ "dateFormatLabel": "Бажаний формат дати", "dateFormatHint": "Виберіть, як дати відображаються в застосунку.", "dateFormatSavedToast": "Формат дати збережено.", + "timeFormatLabel": "Формат часу", + "timeFormatHours": "годин", + "timeFormatSavedToast": "Формат часу збережено.", "themeSystem": "Системна", "themeSysLabel": "Використовувати системні налаштування", "themeLight": "Світла", diff --git a/public/locales/zh.json b/public/locales/zh.json index e0ef6e8..babffb6 100644 --- a/public/locales/zh.json +++ b/public/locales/zh.json @@ -607,6 +607,9 @@ "dateFormatLabel": "首选日期格式", "dateFormatHint": "选择日期在应用中的显示方式。", "dateFormatSavedToast": "日期格式已保存。", + "timeFormatLabel": "时间格式", + "timeFormatHours": "小时", + "timeFormatSavedToast": "时间格式已保存。", "themeSystem": "跟随系统", "themeSysLabel": "使用系统设置", "themeLight": "浅色", diff --git a/public/pages/calendar.js b/public/pages/calendar.js index 667348d..d5cb96a 100644 --- a/public/pages/calendar.js +++ b/public/pages/calendar.js @@ -226,9 +226,7 @@ function setSavedCalendarView(view) { if (!VIEWS.includes(view)) return; try { localStorage.setItem(CALENDAR_VIEW_STORAGE_KEY, view); - } catch { - // Ignore storage failures; view still works for this session. - } + } catch {} } // Extract YYYY-MM-DD in the browser's local timezone from any datetime string. diff --git a/server/routes/preferences.js b/server/routes/preferences.js index e7e8376..ce81401 100644 --- a/server/routes/preferences.js +++ b/server/routes/preferences.js @@ -148,7 +148,7 @@ router.put('/', (req, res) => { if (time_format !== undefined) { if (!VALID_TIME_FORMATS.includes(time_format)) { - return res.status(400).json({ error: `Ungültiges Zeitformat. Erlaubt: ${VALID_TIME_FORMATS.join(', ')}`, code: 400 }); + return res.status(400).json({ error: `Invalid time format. Allowed: ${VALID_TIME_FORMATS.join(', ')}`, code: 400 }); } cfgSet('time_format', time_format); }