Translation followup (#9735)
Address PR comments and more progress on translation
This commit is contained in:
@ -4,6 +4,7 @@ import { DateFormat } from '@/localization/constants/DateFormat';
|
||||
import { detectDateFormat } from '@/localization/utils/detectDateFormat';
|
||||
import { detectTimeZone } from '@/localization/utils/detectTimeZone';
|
||||
import { Select } from '@/ui/input/components/Select';
|
||||
import { t } from '@lingui/core/macro';
|
||||
|
||||
type DateTimeSettingsDateFormatSelectProps = {
|
||||
value: DateFormat;
|
||||
@ -22,6 +23,12 @@ export const DateTimeSettingsDateFormatSelect = ({
|
||||
|
||||
const systemDateFormat = DateFormat[detectDateFormat()];
|
||||
|
||||
const systemDateFormatLabel = formatInTimeZone(
|
||||
Date.now(),
|
||||
usedTimeZone,
|
||||
systemDateFormat,
|
||||
);
|
||||
|
||||
return (
|
||||
<Select
|
||||
dropdownId="datetime-settings-date-format"
|
||||
@ -32,11 +39,7 @@ export const DateTimeSettingsDateFormatSelect = ({
|
||||
value={value}
|
||||
options={[
|
||||
{
|
||||
label: `System settings - ${formatInTimeZone(
|
||||
Date.now(),
|
||||
usedTimeZone,
|
||||
systemDateFormat,
|
||||
)}`,
|
||||
label: t`System settings - ${systemDateFormatLabel}`,
|
||||
value: DateFormat.SYSTEM,
|
||||
},
|
||||
{
|
||||
|
||||
@ -4,6 +4,7 @@ import { TimeFormat } from '@/localization/constants/TimeFormat';
|
||||
import { detectTimeFormat } from '@/localization/utils/detectTimeFormat';
|
||||
import { detectTimeZone } from '@/localization/utils/detectTimeZone';
|
||||
import { Select } from '@/ui/input/components/Select';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
|
||||
type DateTimeSettingsTimeFormatSelectProps = {
|
||||
value: TimeFormat;
|
||||
@ -16,43 +17,50 @@ export const DateTimeSettingsTimeFormatSelect = ({
|
||||
timeZone,
|
||||
value,
|
||||
}: DateTimeSettingsTimeFormatSelectProps) => {
|
||||
const { t } = useLingui();
|
||||
const systemTimeZone = detectTimeZone();
|
||||
|
||||
const usedTimeZone = timeZone === 'system' ? systemTimeZone : timeZone;
|
||||
|
||||
const systemTimeFormat = TimeFormat[detectTimeFormat()];
|
||||
|
||||
const systemTimeFormatLabel = formatInTimeZone(
|
||||
Date.now(),
|
||||
usedTimeZone,
|
||||
systemTimeFormat,
|
||||
);
|
||||
|
||||
const hour24Label = formatInTimeZone(
|
||||
Date.now(),
|
||||
usedTimeZone,
|
||||
TimeFormat.HOUR_24,
|
||||
);
|
||||
|
||||
const hour12Label = formatInTimeZone(
|
||||
Date.now(),
|
||||
usedTimeZone,
|
||||
TimeFormat.HOUR_12,
|
||||
);
|
||||
|
||||
return (
|
||||
<Select
|
||||
dropdownId="datetime-settings-time-format"
|
||||
dropdownWidth={218}
|
||||
label="Time format"
|
||||
label={t`Time format`}
|
||||
dropdownWidthAuto
|
||||
fullWidth
|
||||
value={value}
|
||||
options={[
|
||||
{
|
||||
label: `System Settings - ${formatInTimeZone(
|
||||
Date.now(),
|
||||
usedTimeZone,
|
||||
systemTimeFormat,
|
||||
)}`,
|
||||
label: t`System Settings - ${systemTimeFormatLabel}`,
|
||||
value: TimeFormat.SYSTEM,
|
||||
},
|
||||
{
|
||||
label: `24h (${formatInTimeZone(
|
||||
Date.now(),
|
||||
usedTimeZone,
|
||||
TimeFormat.HOUR_24,
|
||||
)})`,
|
||||
label: t`24h (${hour24Label})`,
|
||||
value: TimeFormat.HOUR_24,
|
||||
},
|
||||
{
|
||||
label: `12h (${formatInTimeZone(
|
||||
Date.now(),
|
||||
usedTimeZone,
|
||||
TimeFormat.HOUR_12,
|
||||
)})`,
|
||||
label: t`12h (${hour12Label})`,
|
||||
value: TimeFormat.HOUR_12,
|
||||
},
|
||||
]}
|
||||
|
||||
Reference in New Issue
Block a user