mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-12-29 16:16:02 +00:00
fix: i18n tsc
This commit is contained in:
@@ -113,7 +113,7 @@ id,name,active
|
||||
];
|
||||
|
||||
export default function CsvToJson({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('csv');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -149,35 +149,35 @@ export default function CsvToJson({ title }: ToolComponentProps) {
|
||||
exampleCards={exampleCards}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('csv:csvToJson.inputTitle')}
|
||||
title={t('csvToJson.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('csv:csvToJson.resultTitle')}
|
||||
title={t('csvToJson.resultTitle')}
|
||||
value={result}
|
||||
extension={'json'}
|
||||
/>
|
||||
}
|
||||
getGroups={({ values, updateField }) => [
|
||||
{
|
||||
title: t('csv:csvToJson.inputCsvFormat'),
|
||||
title: t('csvToJson.inputCsvFormat'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
description={t('csv:csvToJson.columnSeparator')}
|
||||
description={t('csvToJson.columnSeparator')}
|
||||
value={values.delimiter}
|
||||
onOwnChange={(val) => updateField('delimiter', val)}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
description={t('csv:csvToJson.fieldQuote')}
|
||||
description={t('csvToJson.fieldQuote')}
|
||||
onOwnChange={(val) => updateField('quote', val)}
|
||||
value={values.quote}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
description={t('csv:csvToJson.commentSymbol')}
|
||||
description={t('csvToJson.commentSymbol')}
|
||||
value={values.comment}
|
||||
onOwnChange={(val) => updateField('comment', val)}
|
||||
/>
|
||||
@@ -185,26 +185,26 @@ export default function CsvToJson({ title }: ToolComponentProps) {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('csv:csvToJson.conversionOptions'),
|
||||
title: t('csvToJson.conversionOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<CheckboxWithDesc
|
||||
checked={values.useHeaders}
|
||||
onChange={(value) => updateField('useHeaders', value)}
|
||||
title={t('csv:csvToJson.useHeaders')}
|
||||
description={t('csv:csvToJson.useHeadersDescription')}
|
||||
title={t('csvToJson.useHeaders')}
|
||||
description={t('csvToJson.useHeadersDescription')}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
checked={values.skipEmptyLines}
|
||||
onChange={(value) => updateField('skipEmptyLines', value)}
|
||||
title={t('csv:csvToJson.skipEmptyLines')}
|
||||
description={t('csv:csvToJson.skipEmptyLinesDescription')}
|
||||
title={t('csvToJson.skipEmptyLines')}
|
||||
description={t('csvToJson.skipEmptyLinesDescription')}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
checked={values.dynamicTypes}
|
||||
onChange={(value) => updateField('dynamicTypes', value)}
|
||||
title={t('csv:csvToJson.dynamicTypes')}
|
||||
description={t('csv:csvToJson.dynamicTypesDescription')}
|
||||
title={t('csvToJson.dynamicTypes')}
|
||||
description={t('csvToJson.dynamicTypesDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
|
||||
@@ -104,7 +104,7 @@ export default function FindIncompleteCsvRecords({
|
||||
title,
|
||||
longDescription
|
||||
}: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('csv');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -117,7 +117,7 @@ export default function FindIncompleteCsvRecords({
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('csv:findIncompleteCsvRecords.csvInputOptions'),
|
||||
title: t('findIncompleteCsvRecords.csvInputOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
@@ -145,13 +145,13 @@ export default function FindIncompleteCsvRecords({
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('csv:findIncompleteCsvRecords.checkingOptions'),
|
||||
title: t('findIncompleteCsvRecords.checkingOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<CheckboxWithDesc
|
||||
checked={values.emptyLines}
|
||||
onChange={(value) => updateField('emptyLines', value)}
|
||||
title={t('csv:findIncompleteCsvRecords.deleteLinesWithNoData')}
|
||||
title={t('findIncompleteCsvRecords.deleteLinesWithNoData')}
|
||||
description={t(
|
||||
'csv:findIncompleteCsvRecords.deleteLinesWithNoDataDescription'
|
||||
)}
|
||||
@@ -160,7 +160,7 @@ export default function FindIncompleteCsvRecords({
|
||||
<CheckboxWithDesc
|
||||
checked={values.emptyValues}
|
||||
onChange={(value) => updateField('emptyValues', value)}
|
||||
title={t('csv:findIncompleteCsvRecords.findEmptyValues')}
|
||||
title={t('findIncompleteCsvRecords.findEmptyValues')}
|
||||
description={t(
|
||||
'csv:findIncompleteCsvRecords.findEmptyValuesDescription'
|
||||
)}
|
||||
@@ -169,7 +169,7 @@ export default function FindIncompleteCsvRecords({
|
||||
<CheckboxWithDesc
|
||||
checked={values.messageLimit}
|
||||
onChange={(value) => updateField('messageLimit', value)}
|
||||
title={t('csv:findIncompleteCsvRecords.limitNumberOfMessages')}
|
||||
title={t('findIncompleteCsvRecords.limitNumberOfMessages')}
|
||||
/>
|
||||
|
||||
{values.messageLimit && (
|
||||
@@ -193,14 +193,14 @@ export default function FindIncompleteCsvRecords({
|
||||
input={input}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('csv:findIncompleteCsvRecords.inputTitle')}
|
||||
title={t('findIncompleteCsvRecords.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('csv:findIncompleteCsvRecords.resultTitle')}
|
||||
title={t('findIncompleteCsvRecords.resultTitle')}
|
||||
value={result}
|
||||
/>
|
||||
}
|
||||
@@ -210,7 +210,7 @@ export default function FindIncompleteCsvRecords({
|
||||
setInput={setInput}
|
||||
compute={compute}
|
||||
toolInfo={{
|
||||
title: t('csv:findIncompleteCsvRecords.toolInfo.title', { title }),
|
||||
title: t('findIncompleteCsvRecords.toolInfo.title', { title }),
|
||||
description: longDescription
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -123,7 +123,7 @@ export default function InsertCsvColumns({
|
||||
title,
|
||||
longDescription
|
||||
}: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('csv');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -145,7 +145,7 @@ export default function InsertCsvColumns({
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('csv:insertCsvColumns.csvToInsert'),
|
||||
title: t('insertCsvColumns.csvToInsert'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
@@ -153,40 +153,40 @@ export default function InsertCsvColumns({
|
||||
rows={3}
|
||||
value={values.csvToInsert}
|
||||
onOwnChange={(val) => updateField('csvToInsert', val)}
|
||||
title={t('csv:insertCsvColumns.csvSeparator')}
|
||||
description={t('csv:insertCsvColumns.csvToInsertDescription')}
|
||||
title={t('insertCsvColumns.csvSeparator')}
|
||||
description={t('insertCsvColumns.csvToInsertDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('csv:insertCsvColumns.csvOptions'),
|
||||
title: t('insertCsvColumns.csvOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
value={values.separator}
|
||||
onOwnChange={(val) => updateField('separator', val)}
|
||||
description={t('csv:insertCsvColumns.separatorDescription')}
|
||||
description={t('insertCsvColumns.separatorDescription')}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.quoteChar}
|
||||
onOwnChange={(val) => updateField('quoteChar', val)}
|
||||
description={t('csv:insertCsvColumns.quoteCharDescription')}
|
||||
description={t('insertCsvColumns.quoteCharDescription')}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.commentCharacter}
|
||||
onOwnChange={(val) => updateField('commentCharacter', val)}
|
||||
description={t('csv:insertCsvColumns.commentCharacterDescription')}
|
||||
description={t('insertCsvColumns.commentCharacterDescription')}
|
||||
/>
|
||||
<SelectWithDesc
|
||||
selected={values.customFill}
|
||||
options={[
|
||||
{
|
||||
label: t('csv:insertCsvColumns.fillWithEmptyValues'),
|
||||
label: t('insertCsvColumns.fillWithEmptyValues'),
|
||||
value: false
|
||||
},
|
||||
{
|
||||
label: t('csv:insertCsvColumns.fillWithCustomValues'),
|
||||
label: t('insertCsvColumns.fillWithCustomValues'),
|
||||
value: true
|
||||
}
|
||||
]}
|
||||
@@ -196,40 +196,40 @@ export default function InsertCsvColumns({
|
||||
updateField('customFillValue', ''); // Reset custom fill value
|
||||
}
|
||||
}}
|
||||
description={t('csv:insertCsvColumns.customFillDescription')}
|
||||
description={t('insertCsvColumns.customFillDescription')}
|
||||
/>
|
||||
{values.customFill && (
|
||||
<TextFieldWithDesc
|
||||
value={values.customFillValue}
|
||||
onOwnChange={(val) => updateField('customFillValue', val)}
|
||||
description={t('csv:insertCsvColumns.customFillValueDescription')}
|
||||
description={t('insertCsvColumns.customFillValueDescription')}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('csv:insertCsvColumns.positionOptions'),
|
||||
title: t('insertCsvColumns.positionOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<SelectWithDesc
|
||||
selected={values.insertingPosition}
|
||||
options={[
|
||||
{
|
||||
label: t('csv:insertCsvColumns.prependColumns'),
|
||||
label: t('insertCsvColumns.prependColumns'),
|
||||
value: 'prepend'
|
||||
},
|
||||
{
|
||||
label: t('csv:insertCsvColumns.appendColumns'),
|
||||
label: t('insertCsvColumns.appendColumns'),
|
||||
value: 'append'
|
||||
},
|
||||
{
|
||||
label: t('csv:insertCsvColumns.customPosition'),
|
||||
label: t('insertCsvColumns.customPosition'),
|
||||
value: 'custom'
|
||||
}
|
||||
]}
|
||||
onChange={(value) => updateField('insertingPosition', value)}
|
||||
description={t('csv:insertCsvColumns.insertingPositionDescription')}
|
||||
description={t('insertCsvColumns.insertingPositionDescription')}
|
||||
/>
|
||||
|
||||
{values.insertingPosition === 'custom' && (
|
||||
@@ -237,11 +237,11 @@ export default function InsertCsvColumns({
|
||||
selected={values.customPostionOptions}
|
||||
options={[
|
||||
{
|
||||
label: t('csv:insertCsvColumns.headerName'),
|
||||
label: t('insertCsvColumns.headerName'),
|
||||
value: 'headerName'
|
||||
},
|
||||
{
|
||||
label: t('csv:insertCsvColumns.position'),
|
||||
label: t('insertCsvColumns.position'),
|
||||
value: 'rowNumber'
|
||||
}
|
||||
]}
|
||||
@@ -258,7 +258,7 @@ export default function InsertCsvColumns({
|
||||
selected={values.headerName}
|
||||
options={headerOptions}
|
||||
onChange={(value) => updateField('headerName', value)}
|
||||
description={t('csv:insertCsvColumns.headerNameDescription')}
|
||||
description={t('insertCsvColumns.headerNameDescription')}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -269,7 +269,7 @@ export default function InsertCsvColumns({
|
||||
onOwnChange={(val) =>
|
||||
updateField('rowNumber', parseInt(val) || 0)
|
||||
}
|
||||
description={t('csv:insertCsvColumns.rowNumberDescription')}
|
||||
description={t('insertCsvColumns.rowNumberDescription')}
|
||||
type="number"
|
||||
/>
|
||||
)}
|
||||
@@ -283,14 +283,14 @@ export default function InsertCsvColumns({
|
||||
title={title}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('csv:insertCsvColumns.inputTitle')}
|
||||
title={t('insertCsvColumns.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('csv:insertCsvColumns.resultTitle')}
|
||||
title={t('insertCsvColumns.resultTitle')}
|
||||
value={result}
|
||||
extension={'csv'}
|
||||
/>
|
||||
@@ -301,8 +301,8 @@ export default function InsertCsvColumns({
|
||||
input={input}
|
||||
setInput={setInput}
|
||||
toolInfo={{
|
||||
title: t('csv:insertCsvColumns.toolInfo.title'),
|
||||
description: t('csv:insertCsvColumns.toolInfo.description')
|
||||
title: t('insertCsvColumns.toolInfo.title'),
|
||||
description: t('insertCsvColumns.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user