diff --git a/components/settings/language-settings.tsx b/components/settings/language-settings.tsx index 4cc49d8b7..cc0477e8f 100644 --- a/components/settings/language-settings.tsx +++ b/components/settings/language-settings.tsx @@ -7,6 +7,7 @@ import { useLocaleStore } from '@/stores/locale-store'; import { useSettingsStore } from '@/stores/settings-store'; import type { DateFormat, DateLocale, TimeFormat, FirstDayOfWeek } from '@/stores/settings-store'; import { formatDate } from '@/lib/utils'; +import { getEffectiveLocale } from '@/i18n/detect-locale'; import { AUTO_TIME_ZONE, getBrowserTimeZone, getEffectiveTimeZone, listTimeZones } from '@/lib/timezone'; import { SettingsSection, SettingItem, Select, RadioGroup } from './settings-section'; @@ -60,6 +61,23 @@ export function LanguageSettings() { }; }, [locale, dateFormat, dateLocale, timeFormat, timeZone]); + // Today's date in the UI language's numeric order, so "Automatic" names + // the format it resolves to instead of a vague "match language". + const autoDateExample = useMemo(() => { + void locale; void timeZone; + const uiLocale = getEffectiveLocale(); + try { + return new Date().toLocaleDateString(uiLocale === 'en' ? 'en-US' : uiLocale, { + timeZone: getEffectiveTimeZone(), + year: 'numeric', + month: '2-digit', + day: '2-digit', + }); + } catch { + return ''; + } + }, [locale, timeZone]); + // Current wall-clock in the effective zone so a pick can be sanity-checked. const timeZonePreview = useMemo(() => { void timeZone; void timeFormat; void locale; @@ -115,7 +133,7 @@ export function LanguageSettings() { value={dateLocale} onChange={(value) => updateSetting('dateLocale', value as DateLocale)} options={[ - { value: 'auto', label: t('date_locale.auto') }, + { value: 'auto', label: t('date_locale.auto', { example: autoDateExample }) }, { value: 'iso', label: t('date_locale.iso') }, { value: 'en-GB', label: t('date_locale.dmy') }, { value: 'en-US', label: t('date_locale.mdy') }, diff --git a/locales/ar/common.json b/locales/ar/common.json index 65a04f5ff..f95e09c20 100644 --- a/locales/ar/common.json +++ b/locales/ar/common.json @@ -1329,7 +1329,7 @@ "date_locale": { "label": "منطقة تنسيق التاريخ", "description": "كيفية ترتيب التاريخ الرقمي (يوم، شهر، سنة)", - "auto": "تلقائي (يطابق اللغة)", + "auto": "تلقائي ({example})", "iso": "ISO 8601 (سنة-شهر-يوم)", "dmy": "يوم/شهر/سنة", "mdy": "شهر/يوم/سنة" diff --git a/locales/ca/common.json b/locales/ca/common.json index 3bf29f62c..51e9910da 100644 --- a/locales/ca/common.json +++ b/locales/ca/common.json @@ -1329,7 +1329,7 @@ "date_locale": { "label": "Regió del format de data", "description": "Com s'ordenen les dates numèriques (dia, mes, any)", - "auto": "Automàtic (segons l'idioma)", + "auto": "Automàtic ({example})", "iso": "ISO 8601 (AAAA-MM-DD)", "dmy": "Dia/Mes/Any", "mdy": "Mes/Dia/Any" diff --git a/locales/cs/common.json b/locales/cs/common.json index 8b2bcc8c1..54db3579d 100644 --- a/locales/cs/common.json +++ b/locales/cs/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Region formátu data", "description": "Pořadí částí číselného data (den, měsíc, rok)", - "auto": "Automaticky (podle jazyka)", + "auto": "Automaticky ({example})", "iso": "ISO 8601 (RRRR-MM-DD)", "dmy": "Den/měsíc/rok", "mdy": "Měsíc/den/rok" diff --git a/locales/da/common.json b/locales/da/common.json index dc74429f0..4801227ae 100644 --- a/locales/da/common.json +++ b/locales/da/common.json @@ -1329,7 +1329,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/de/common.json b/locales/de/common.json index 3771589f2..ee523a75c 100644 --- a/locales/de/common.json +++ b/locales/de/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Region für Datumsformat", "description": "Legt fest, in welcher Reihenfolge numerische Datumsangaben angezeigt werden (Tag, Monat, Jahr).", - "auto": "Automatisch (passend zur Sprache)", + "auto": "Automatisch ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Tag/Monat/Jahr", "mdy": "Monat/Tag/Jahr" diff --git a/locales/en/common.json b/locales/en/common.json index 910aef2e7..91fc491a4 100644 --- a/locales/en/common.json +++ b/locales/en/common.json @@ -1329,7 +1329,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/es/common.json b/locales/es/common.json index e616386ca..e98afad7c 100644 --- a/locales/es/common.json +++ b/locales/es/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/fa/common.json b/locales/fa/common.json index 50dbdbd2c..473403ca0 100644 --- a/locales/fa/common.json +++ b/locales/fa/common.json @@ -1329,7 +1329,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/fr/common.json b/locales/fr/common.json index 24096232a..fb01ca611 100644 --- a/locales/fr/common.json +++ b/locales/fr/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/he/common.json b/locales/he/common.json index 2bfbc2b3f..ba2aa4237 100644 --- a/locales/he/common.json +++ b/locales/he/common.json @@ -1291,7 +1291,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/hu/common.json b/locales/hu/common.json index e3c291718..2b92a627e 100644 --- a/locales/hu/common.json +++ b/locales/hu/common.json @@ -1329,7 +1329,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/it/common.json b/locales/it/common.json index 07191b618..62782d777 100644 --- a/locales/it/common.json +++ b/locales/it/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/ja/common.json b/locales/ja/common.json index cc3ccdeb2..cda8806fa 100644 --- a/locales/ja/common.json +++ b/locales/ja/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/ko/common.json b/locales/ko/common.json index 9c672f94b..a8330a7b7 100644 --- a/locales/ko/common.json +++ b/locales/ko/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/lv/common.json b/locales/lv/common.json index 10440ab1c..651d34718 100644 --- a/locales/lv/common.json +++ b/locales/lv/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/mn/common.json b/locales/mn/common.json index d6fcd8722..04b4a8fe0 100644 --- a/locales/mn/common.json +++ b/locales/mn/common.json @@ -1329,7 +1329,7 @@ "date_locale": { "label": "Огнооны форматын бүс", "description": "Тоон огноог хэрхэн эрэмбэлэх вэ (өдөр, сар, жил)", - "auto": "Автомат (тохирох хэл)", + "auto": "Автомат ({example})", "iso": "ISO", "dmy": "Өдөр/Сар/Жил", "mdy": "Сар/Өдөр/Жил" diff --git a/locales/nb/common.json b/locales/nb/common.json index 30b190a0a..1f690c084 100644 --- a/locales/nb/common.json +++ b/locales/nb/common.json @@ -1329,7 +1329,7 @@ "date_locale": { "label": "Regionalt datoformat", "description": "Rekkefølgen i numeriske datoer (dag, måned og år)", - "auto": "Automatisk (følger språket)", + "auto": "Automatisk ({example})", "iso": "ISO 8601 (ÅÅÅÅ-MM-DD)", "dmy": "Dag/måned/år", "mdy": "Måned/dag/år" diff --git a/locales/nl/common.json b/locales/nl/common.json index 00dd6fee1..89205d87c 100644 --- a/locales/nl/common.json +++ b/locales/nl/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/pl/common.json b/locales/pl/common.json index 7a9f8c61e..ab4b424d5 100644 --- a/locales/pl/common.json +++ b/locales/pl/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/pt/common.json b/locales/pt/common.json index d00028b63..b6c863d4d 100644 --- a/locales/pt/common.json +++ b/locales/pt/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Formato de data da região", "description": "Como as datas numéricas são ordenadas (dia, mês, ano)", - "auto": "Automático (corresponder ao idioma)", + "auto": "Automático ({example})", "iso": "ISO 8601 (AAAA-MM-DD)", "dmy": "Dia/Mês/Ano", "mdy": "Mês/Dia/Ano" diff --git a/locales/ro/common.json b/locales/ro/common.json index 0037165c4..b269eb874 100644 --- a/locales/ro/common.json +++ b/locales/ro/common.json @@ -1329,7 +1329,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/ru/common.json b/locales/ru/common.json index e99ea5911..588591b6a 100644 --- a/locales/ru/common.json +++ b/locales/ru/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/sk/common.json b/locales/sk/common.json index e0980a273..9240eb932 100644 --- a/locales/sk/common.json +++ b/locales/sk/common.json @@ -1329,7 +1329,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/tr/common.json b/locales/tr/common.json index c4683d2c8..342b97629 100644 --- a/locales/tr/common.json +++ b/locales/tr/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/uk/common.json b/locales/uk/common.json index 8aeb108a4..42d6565ff 100644 --- a/locales/uk/common.json +++ b/locales/uk/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year" diff --git a/locales/zh-TW/common.json b/locales/zh-TW/common.json index 5fb6d3263..367847421 100644 --- a/locales/zh-TW/common.json +++ b/locales/zh-TW/common.json @@ -1329,7 +1329,7 @@ "date_locale": { "label": "日期格式地區", "description": "數字日期的排列順序(日、月、年)", - "auto": "自動(與語言相符)", + "auto": "自動({example})", "iso": "ISO 8601(YYYY-MM-DD)", "dmy": "日/月/年", "mdy": "月/日/年" diff --git a/locales/zh/common.json b/locales/zh/common.json index dd1dddf08..b0406a81c 100644 --- a/locales/zh/common.json +++ b/locales/zh/common.json @@ -1326,7 +1326,7 @@ "date_locale": { "label": "Date format region", "description": "How numeric dates are ordered (day, month, year)", - "auto": "Automatic (match language)", + "auto": "Automatic ({example})", "iso": "ISO 8601 (YYYY-MM-DD)", "dmy": "Day/Month/Year", "mdy": "Month/Day/Year"