mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-21 15:09:32 +02:00
fix: i18n tsc
This commit is contained in:
@@ -57,7 +57,7 @@ export default function ConvertDaysToHours({
|
||||
title,
|
||||
longDescription
|
||||
}: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('time');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -78,7 +78,7 @@ export default function ConvertDaysToHours({
|
||||
setInput={setInput}
|
||||
compute={compute}
|
||||
toolInfo={{
|
||||
title: t('time:checkLeapYears.toolInfo.title', { title }),
|
||||
title: t('checkLeapYears.toolInfo.title', { title }),
|
||||
description: longDescription
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
|
@@ -63,7 +63,7 @@ export default function ConvertDaysToHours({
|
||||
title,
|
||||
longDescription
|
||||
}: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('time');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -76,14 +76,14 @@ export default function ConvertDaysToHours({
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('time:convertDaysToHours.hoursName'),
|
||||
title: t('convertDaysToHours.hoursName'),
|
||||
component: (
|
||||
<Box>
|
||||
<CheckboxWithDesc
|
||||
onChange={(val) => updateField('hoursFlag', val)}
|
||||
checked={values.hoursFlag}
|
||||
title={t('time:convertDaysToHours.addHoursName')}
|
||||
description={t('time:convertDaysToHours.addHoursNameDescription')}
|
||||
title={t('convertDaysToHours.addHoursName')}
|
||||
description={t('convertDaysToHours.addHoursNameDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
@@ -101,8 +101,8 @@ export default function ConvertDaysToHours({
|
||||
setInput={setInput}
|
||||
compute={compute}
|
||||
toolInfo={{
|
||||
title: t('time:convertDaysToHours.toolInfo.title'),
|
||||
description: t('time:convertDaysToHours.toolInfo.description')
|
||||
title: t('convertDaysToHours.toolInfo.title'),
|
||||
description: t('convertDaysToHours.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
/>
|
||||
|
@@ -69,7 +69,7 @@ export default function SecondsToTime({
|
||||
title,
|
||||
longDescription
|
||||
}: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('time');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -82,14 +82,14 @@ export default function SecondsToTime({
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('time:convertSecondsToTime.timePadding'),
|
||||
title: t('convertSecondsToTime.timePadding'),
|
||||
component: (
|
||||
<Box>
|
||||
<CheckboxWithDesc
|
||||
onChange={(val) => updateField('paddingFlag', val)}
|
||||
checked={values.paddingFlag}
|
||||
title={t('time:convertSecondsToTime.addPadding')}
|
||||
description={t('time:convertSecondsToTime.addPaddingDescription')}
|
||||
title={t('convertSecondsToTime.addPadding')}
|
||||
description={t('convertSecondsToTime.addPaddingDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
@@ -107,7 +107,7 @@ export default function SecondsToTime({
|
||||
setInput={setInput}
|
||||
compute={compute}
|
||||
toolInfo={{
|
||||
title: t('time:convertSecondsToTime.toolInfo.title', { title }),
|
||||
title: t('convertSecondsToTime.toolInfo.title', { title }),
|
||||
description: longDescription
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
|
@@ -76,7 +76,7 @@ export default function TimeToSeconds({
|
||||
title,
|
||||
longDescription
|
||||
}: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('time');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -95,7 +95,7 @@ export default function TimeToSeconds({
|
||||
setInput={setInput}
|
||||
compute={compute}
|
||||
toolInfo={{
|
||||
title: t('time:convertTimeToSeconds.toolInfo.title', { title }),
|
||||
title: t('convertTimeToSeconds.toolInfo.title', { title }),
|
||||
description: longDescription
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
|
@@ -121,12 +121,12 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||
];
|
||||
|
||||
export default function TimeBetweenDates() {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('time');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
return (
|
||||
<ToolContent
|
||||
title={t('time:timeBetweenDates.title')}
|
||||
title={t('timeBetweenDates.title')}
|
||||
inputComponent={null}
|
||||
resultComponent={
|
||||
result ? (
|
||||
@@ -155,28 +155,28 @@ export default function TimeBetweenDates() {
|
||||
validationSchema={validationSchema}
|
||||
exampleCards={exampleCards}
|
||||
toolInfo={{
|
||||
title: t('time:timeBetweenDates.toolInfo.title'),
|
||||
description: t('time:timeBetweenDates.toolInfo.description')
|
||||
title: t('timeBetweenDates.toolInfo.title'),
|
||||
description: t('timeBetweenDates.toolInfo.description')
|
||||
}}
|
||||
getGroups={({ values, updateField }) => [
|
||||
{
|
||||
title: t('time:timeBetweenDates.startDateTime'),
|
||||
title: t('timeBetweenDates.startDateTime'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
description={t('time:timeBetweenDates.startDate')}
|
||||
description={t('timeBetweenDates.startDate')}
|
||||
value={values.startDate}
|
||||
onOwnChange={(val) => updateField('startDate', val)}
|
||||
type="date"
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
description={t('time:timeBetweenDates.startTime')}
|
||||
description={t('timeBetweenDates.startTime')}
|
||||
value={values.startTime}
|
||||
onOwnChange={(val) => updateField('startTime', val)}
|
||||
type="time"
|
||||
/>
|
||||
<SelectWithDesc
|
||||
description={t('time:timeBetweenDates.startTimezone')}
|
||||
description={t('timeBetweenDates.startTimezone')}
|
||||
selected={values.startTimezone}
|
||||
onChange={(val: string) => updateField('startTimezone', val)}
|
||||
options={timezoneOptions}
|
||||
@@ -185,23 +185,23 @@ export default function TimeBetweenDates() {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('time:timeBetweenDates.endDateTime'),
|
||||
title: t('timeBetweenDates.endDateTime'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
description={t('time:timeBetweenDates.endDate')}
|
||||
description={t('timeBetweenDates.endDate')}
|
||||
value={values.endDate}
|
||||
onOwnChange={(val) => updateField('endDate', val)}
|
||||
type="date"
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
description={t('time:timeBetweenDates.endTime')}
|
||||
description={t('timeBetweenDates.endTime')}
|
||||
value={values.endTime}
|
||||
onOwnChange={(val) => updateField('endTime', val)}
|
||||
type="time"
|
||||
/>
|
||||
<SelectWithDesc
|
||||
description={t('time:timeBetweenDates.endTimezone')}
|
||||
description={t('timeBetweenDates.endTimezone')}
|
||||
selected={values.endTimezone}
|
||||
onChange={(val: string) => updateField('endTimezone', val)}
|
||||
options={timezoneOptions}
|
||||
|
@@ -68,7 +68,7 @@ export default function TruncateClockTime({
|
||||
title,
|
||||
longDescription
|
||||
}: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('time');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -88,13 +88,13 @@ export default function TruncateClockTime({
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('time:truncateClockTime.truncationSide'),
|
||||
title: t('truncateClockTime.truncationSide'),
|
||||
component: (
|
||||
<Box>
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('onlySecond', true)}
|
||||
checked={values.onlySecond}
|
||||
title={t('time:truncateClockTime.truncateOnlySeconds')}
|
||||
title={t('truncateClockTime.truncateOnlySeconds')}
|
||||
description={t(
|
||||
'time:truncateClockTime.truncateOnlySecondsDescription'
|
||||
)}
|
||||
@@ -102,7 +102,7 @@ export default function TruncateClockTime({
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('onlySecond', false)}
|
||||
checked={!values.onlySecond}
|
||||
title={t('time:truncateClockTime.truncateMinutesAndSeconds')}
|
||||
title={t('truncateClockTime.truncateMinutesAndSeconds')}
|
||||
description={t(
|
||||
'time:truncateClockTime.truncateMinutesAndSecondsDescription'
|
||||
)}
|
||||
@@ -111,27 +111,27 @@ export default function TruncateClockTime({
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('time:truncateClockTime.printDroppedComponents'),
|
||||
title: t('truncateClockTime.printDroppedComponents'),
|
||||
component: (
|
||||
<Box>
|
||||
<CheckboxWithDesc
|
||||
onChange={(val) => updateField('zeroPrint', val)}
|
||||
checked={values.zeroPrint}
|
||||
title={t('time:truncateClockTime.zeroPrintTruncatedParts')}
|
||||
description={t('time:truncateClockTime.zeroPrintDescription')}
|
||||
title={t('truncateClockTime.zeroPrintTruncatedParts')}
|
||||
description={t('truncateClockTime.zeroPrintDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('time:truncateClockTime.timePadding'),
|
||||
title: t('truncateClockTime.timePadding'),
|
||||
component: (
|
||||
<Box>
|
||||
<CheckboxWithDesc
|
||||
onChange={(val) => updateField('zeroPadding', val)}
|
||||
checked={values.zeroPadding}
|
||||
title={t('time:truncateClockTime.useZeroPadding')}
|
||||
description={t('time:truncateClockTime.zeroPaddingDescription')}
|
||||
title={t('truncateClockTime.useZeroPadding')}
|
||||
description={t('truncateClockTime.zeroPaddingDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
@@ -149,7 +149,7 @@ export default function TruncateClockTime({
|
||||
setInput={setInput}
|
||||
compute={compute}
|
||||
toolInfo={{
|
||||
title: t('time:truncateClockTime.toolInfo.title', { title }),
|
||||
title: t('truncateClockTime.toolInfo.title', { title }),
|
||||
description: longDescription
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
|
Reference in New Issue
Block a user