mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-26 01:19:33 +02:00
fix: i18n tsc
This commit is contained in:
@@ -71,7 +71,7 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||
];
|
||||
|
||||
export default function ArithmeticSequence({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('number');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
return (
|
||||
@@ -80,7 +80,7 @@ export default function ArithmeticSequence({ title }: ToolComponentProps) {
|
||||
inputComponent={null}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('number:arithmeticSequence.resultTitle')}
|
||||
title={t('arithmeticSequence.resultTitle')}
|
||||
value={result}
|
||||
/>
|
||||
}
|
||||
@@ -88,12 +88,12 @@ export default function ArithmeticSequence({ title }: ToolComponentProps) {
|
||||
validationSchema={validationSchema}
|
||||
exampleCards={exampleCards}
|
||||
toolInfo={{
|
||||
title: t('number:arithmeticSequence.toolInfo.title'),
|
||||
description: t('number:arithmeticSequence.toolInfo.description')
|
||||
title: t('arithmeticSequence.toolInfo.title'),
|
||||
description: t('arithmeticSequence.toolInfo.description')
|
||||
}}
|
||||
getGroups={({ values, updateField }) => [
|
||||
{
|
||||
title: t('number:arithmeticSequence.sequenceParameters'),
|
||||
title: t('arithmeticSequence.sequenceParameters'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
@@ -124,10 +124,10 @@ export default function ArithmeticSequence({ title }: ToolComponentProps) {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('number:arithmeticSequence.outputFormat'),
|
||||
title: t('arithmeticSequence.outputFormat'),
|
||||
component: (
|
||||
<TextFieldWithDesc
|
||||
description={t('number:arithmeticSequence.separatorDescription')}
|
||||
description={t('arithmeticSequence.separatorDescription')}
|
||||
value={values.separator}
|
||||
onOwnChange={(val) => updateField('separator', val)}
|
||||
/>
|
||||
|
@@ -15,7 +15,7 @@ const initialValues = {
|
||||
};
|
||||
|
||||
export default function GenerateNumbers({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('number');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
const compute = (optionsValues: typeof initialValues) => {
|
||||
@@ -36,23 +36,23 @@ export default function GenerateNumbers({ title }: ToolComponentProps) {
|
||||
initialValues={initialValues}
|
||||
getGroups={({ values, updateField }) => [
|
||||
{
|
||||
title: t('number:generate.arithmeticSequenceOption'),
|
||||
title: t('generate.arithmeticSequenceOption'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
description={t('number:generate.startSequenceDescription')}
|
||||
description={t('generate.startSequenceDescription')}
|
||||
value={values.firstValue}
|
||||
onOwnChange={(val) => updateField('firstValue', val)}
|
||||
type={'number'}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
description={t('number:generate.stepDescription')}
|
||||
description={t('generate.stepDescription')}
|
||||
value={values.step}
|
||||
onOwnChange={(val) => updateField('step', val)}
|
||||
type={'number'}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
description={t('number:generate.numberOfElementsDescription')}
|
||||
description={t('generate.numberOfElementsDescription')}
|
||||
value={values.numberOfNumbers}
|
||||
onOwnChange={(val) => updateField('numberOfNumbers', val)}
|
||||
type={'number'}
|
||||
@@ -61,10 +61,10 @@ export default function GenerateNumbers({ title }: ToolComponentProps) {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('number:generate.separator'),
|
||||
title: t('generate.separator'),
|
||||
component: (
|
||||
<TextFieldWithDesc
|
||||
description={t('number:generate.separatorDescription')}
|
||||
description={t('generate.separatorDescription')}
|
||||
value={values.separator}
|
||||
onOwnChange={(val) => updateField('separator', val)}
|
||||
/>
|
||||
@@ -73,10 +73,7 @@ export default function GenerateNumbers({ title }: ToolComponentProps) {
|
||||
]}
|
||||
compute={compute}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('number:generate.resultTitle')}
|
||||
value={result}
|
||||
/>
|
||||
<ToolTextResult title={t('generate.resultTitle')} value={result} />
|
||||
}
|
||||
/>
|
||||
);
|
||||
|
@@ -119,7 +119,7 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||
];
|
||||
|
||||
export default function SumNumbers({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('number');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -128,7 +128,7 @@ export default function SumNumbers({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('number:sum.numberExtraction'),
|
||||
title: t('sum.numberExtraction'),
|
||||
component: extractionTypes.map(
|
||||
({ title, description, type, withTextField, textValueAccessor }) =>
|
||||
withTextField ? (
|
||||
@@ -158,11 +158,11 @@ export default function SumNumbers({ title }: ToolComponentProps) {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('number:sum.runningSum'),
|
||||
title: t('sum.runningSum'),
|
||||
component: (
|
||||
<CheckboxWithDesc
|
||||
title={t('number:sum.printRunningSum')}
|
||||
description={t('number:sum.printRunningSumDescription')}
|
||||
title={t('sum.printRunningSum')}
|
||||
description={t('sum.printRunningSumDescription')}
|
||||
checked={values.printRunningSum}
|
||||
onChange={(value) => updateField('printRunningSum', value)}
|
||||
/>
|
||||
@@ -175,13 +175,13 @@ export default function SumNumbers({ title }: ToolComponentProps) {
|
||||
input={input}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('number:sum.inputTitle')}
|
||||
title={t('sum.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('number:sum.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('sum.resultTitle')} value={result} />
|
||||
}
|
||||
initialValues={initialValues}
|
||||
getGroups={getGroups}
|
||||
@@ -191,8 +191,8 @@ export default function SumNumbers({ title }: ToolComponentProps) {
|
||||
}}
|
||||
setInput={setInput}
|
||||
toolInfo={{
|
||||
title: t('number:sum.toolInfo.title'),
|
||||
description: t('number:sum.toolInfo.description')
|
||||
title: t('sum.toolInfo.title'),
|
||||
description: t('sum.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user