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:
@@ -34,7 +34,7 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||
];
|
||||
|
||||
export default function Base64({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -47,18 +47,18 @@ export default function Base64({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('string:base64.optionsTitle'),
|
||||
title: t('base64.optionsTitle'),
|
||||
component: (
|
||||
<Box>
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('mode', 'encode')}
|
||||
checked={values.mode === 'encode'}
|
||||
title={t('string:base64.encode')}
|
||||
title={t('base64.encode')}
|
||||
/>
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('mode', 'decode')}
|
||||
checked={values.mode === 'decode'}
|
||||
title={t('string:base64.decode')}
|
||||
title={t('base64.decode')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
@@ -70,19 +70,19 @@ export default function Base64({ title }: ToolComponentProps) {
|
||||
title={title}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('string:base64.inputTitle')}
|
||||
title={t('base64.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('string:base64.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('base64.resultTitle')} value={result} />
|
||||
}
|
||||
initialValues={initialValues}
|
||||
getGroups={getGroups}
|
||||
toolInfo={{
|
||||
title: t('string:base64.toolInfo.title'),
|
||||
description: t('string:base64.toolInfo.description')
|
||||
title: t('base64.toolInfo.title'),
|
||||
description: t('base64.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
input={input}
|
||||
|
||||
@@ -108,7 +108,7 @@ s
|
||||
];
|
||||
|
||||
export default function JoinText({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
const compute = (optionsValues: InitialValuesType, input: any) => {
|
||||
@@ -121,18 +121,18 @@ export default function JoinText({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('string:join.textMergedOptions'),
|
||||
title: t('join.textMergedOptions'),
|
||||
component: (
|
||||
<TextFieldWithDesc
|
||||
placeholder={t('string:join.joinCharacterPlaceholder')}
|
||||
placeholder={t('join.joinCharacterPlaceholder')}
|
||||
value={values['joinCharacter']}
|
||||
onOwnChange={(value) => updateField(mergeOptions.accessor, value)}
|
||||
description={t('string:join.joinCharacterDescription')}
|
||||
description={t('join.joinCharacterDescription')}
|
||||
/>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('string:join.blankLinesAndTrailingSpaces'),
|
||||
title: t('join.blankLinesAndTrailingSpaces'),
|
||||
component: blankTrailingOptions.map((option) => (
|
||||
<CheckboxWithDesc
|
||||
key={option.accessor}
|
||||
@@ -153,18 +153,18 @@ export default function JoinText({ title }: ToolComponentProps) {
|
||||
setInput={setInput}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('string:join.inputTitle')}
|
||||
title={t('join.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('string:join.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('join.resultTitle')} value={result} />
|
||||
}
|
||||
getGroups={getGroups}
|
||||
toolInfo={{
|
||||
title: t('string:join.toolInfo.title'),
|
||||
description: t('string:join.toolInfo.description')
|
||||
title: t('join.toolInfo.title'),
|
||||
description: t('join.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
/>
|
||||
|
||||
@@ -71,7 +71,7 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||
];
|
||||
|
||||
export default function Quote({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -95,33 +95,33 @@ export default function Quote({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('string:quote.quoteOptions'),
|
||||
title: t('quote.quoteOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
value={values.leftQuote}
|
||||
onOwnChange={(val) => updateField('leftQuote', val)}
|
||||
description={t('string:quote.leftQuoteDescription')}
|
||||
description={t('quote.leftQuoteDescription')}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.rightQuote}
|
||||
onOwnChange={(val) => updateField('rightQuote', val)}
|
||||
description={t('string:quote.rightQuoteDescription')}
|
||||
description={t('quote.rightQuoteDescription')}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
checked={values.doubleQuotation}
|
||||
onChange={(checked) => updateField('doubleQuotation', checked)}
|
||||
title={t('string:quote.allowDoubleQuotation')}
|
||||
title={t('quote.allowDoubleQuotation')}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
checked={values.emptyQuoting}
|
||||
onChange={(checked) => updateField('emptyQuoting', checked)}
|
||||
title={t('string:quote.quoteEmptyLines')}
|
||||
title={t('quote.quoteEmptyLines')}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
checked={values.multiLine}
|
||||
onChange={(checked) => updateField('multiLine', checked)}
|
||||
title={t('string:quote.processAsMultiLine')}
|
||||
title={t('quote.processAsMultiLine')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
@@ -133,19 +133,19 @@ export default function Quote({ title }: ToolComponentProps) {
|
||||
title={title}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('string:quote.inputTitle')}
|
||||
title={t('quote.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('string:quote.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('quote.resultTitle')} value={result} />
|
||||
}
|
||||
initialValues={initialValues}
|
||||
getGroups={getGroups}
|
||||
toolInfo={{
|
||||
title: t('string:quote.toolInfo.title'),
|
||||
description: t('string:quote.toolInfo.description')
|
||||
title: t('quote.toolInfo.title'),
|
||||
description: t('quote.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
input={input}
|
||||
|
||||
@@ -49,7 +49,7 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||
];
|
||||
|
||||
export default function Replacer({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -62,12 +62,12 @@ export default function Replacer({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('string:repeat.textRepetitions'),
|
||||
title: t('repeat.textRepetitions'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
description={t('string:repeat.repeatAmountDescription')}
|
||||
placeholder={t('string:repeat.numberPlaceholder')}
|
||||
description={t('repeat.repeatAmountDescription')}
|
||||
placeholder={t('repeat.numberPlaceholder')}
|
||||
value={values.repeatAmount}
|
||||
onOwnChange={(val) => updateField('repeatAmount', val)}
|
||||
type={'number'}
|
||||
@@ -76,12 +76,12 @@ export default function Replacer({ title }: ToolComponentProps) {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('string:repeat.repetitionsDelimiter'),
|
||||
title: t('repeat.repetitionsDelimiter'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
description={t('string:repeat.delimiterDescription')}
|
||||
placeholder={t('string:repeat.delimiterPlaceholder')}
|
||||
description={t('repeat.delimiterDescription')}
|
||||
placeholder={t('repeat.delimiterPlaceholder')}
|
||||
value={values.delimiter}
|
||||
onOwnChange={(val) => updateField('delimiter', val)}
|
||||
type={'text'}
|
||||
@@ -101,17 +101,17 @@ export default function Replacer({ title }: ToolComponentProps) {
|
||||
setInput={setInput}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('string:repeat.inputTitle')}
|
||||
title={t('repeat.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('string:repeat.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('repeat.resultTitle')} value={result} />
|
||||
}
|
||||
toolInfo={{
|
||||
title: t('string:repeat.toolInfo.title'),
|
||||
description: t('string:repeat.toolInfo.description')
|
||||
title: t('repeat.toolInfo.title'),
|
||||
description: t('repeat.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
/>
|
||||
|
||||
@@ -59,7 +59,7 @@ const exampleCards: CardExampleType<typeof initialValues>[] = [
|
||||
];
|
||||
|
||||
export default function Reverse({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -76,27 +76,27 @@ export default function Reverse({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('string:reverse.reversalOptions'),
|
||||
title: t('reverse.reversalOptions'),
|
||||
component: [
|
||||
<CheckboxWithDesc
|
||||
key="multiLine"
|
||||
checked={values.multiLine}
|
||||
title={t('string:reverse.processMultiLine')}
|
||||
description={t('string:reverse.processMultiLineDescription')}
|
||||
title={t('reverse.processMultiLine')}
|
||||
description={t('reverse.processMultiLineDescription')}
|
||||
onChange={(val) => updateField('multiLine', val)}
|
||||
/>,
|
||||
<CheckboxWithDesc
|
||||
key="emptyItems"
|
||||
checked={values.emptyItems}
|
||||
title={t('string:reverse.skipEmptyLines')}
|
||||
description={t('string:reverse.skipEmptyLinesDescription')}
|
||||
title={t('reverse.skipEmptyLines')}
|
||||
description={t('reverse.skipEmptyLinesDescription')}
|
||||
onChange={(val) => updateField('emptyItems', val)}
|
||||
/>,
|
||||
<CheckboxWithDesc
|
||||
key="trim"
|
||||
checked={values.trim}
|
||||
title={t('string:reverse.trimWhitespace')}
|
||||
description={t('string:reverse.trimWhitespaceDescription')}
|
||||
title={t('reverse.trimWhitespace')}
|
||||
description={t('reverse.trimWhitespaceDescription')}
|
||||
onChange={(val) => updateField('trim', val)}
|
||||
/>
|
||||
]
|
||||
@@ -113,16 +113,13 @@ export default function Reverse({ title }: ToolComponentProps) {
|
||||
setInput={setInput}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('string:reverse.inputTitle')}
|
||||
title={t('reverse.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('string:reverse.resultTitle')}
|
||||
value={result}
|
||||
/>
|
||||
<ToolTextResult title={t('reverse.resultTitle')} value={result} />
|
||||
}
|
||||
exampleCards={exampleCards}
|
||||
/>
|
||||
|
||||
@@ -31,7 +31,7 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||
];
|
||||
|
||||
export default function Rot13({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -44,19 +44,19 @@ export default function Rot13({ title }: ToolComponentProps) {
|
||||
title={title}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('string:rot13.inputTitle')}
|
||||
title={t('rot13.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('string:rot13.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('rot13.resultTitle')} value={result} />
|
||||
}
|
||||
initialValues={initialValues}
|
||||
getGroups={null}
|
||||
toolInfo={{
|
||||
title: t('string:rot13.toolInfo.title'),
|
||||
description: t('string:rot13.toolInfo.description')
|
||||
title: t('rot13.toolInfo.title'),
|
||||
description: t('rot13.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
input={input}
|
||||
|
||||
@@ -64,7 +64,7 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||
];
|
||||
|
||||
export default function Rotate({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -81,29 +81,29 @@ export default function Rotate({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('string:rotate.rotationOptions'),
|
||||
title: t('rotate.rotationOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
value={values.step}
|
||||
onOwnChange={(val) => updateField('step', val)}
|
||||
description={t('string:rotate.stepDescription')}
|
||||
description={t('rotate.stepDescription')}
|
||||
type="number"
|
||||
/>
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('direction', 'right')}
|
||||
checked={values.direction === 'right'}
|
||||
title={t('string:rotate.rotateRight')}
|
||||
title={t('rotate.rotateRight')}
|
||||
/>
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('direction', 'left')}
|
||||
checked={values.direction === 'left'}
|
||||
title={t('string:rotate.rotateLeft')}
|
||||
title={t('rotate.rotateLeft')}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
checked={values.multiLine}
|
||||
onChange={(checked) => updateField('multiLine', checked)}
|
||||
title={t('string:rotate.processAsMultiLine')}
|
||||
title={t('rotate.processAsMultiLine')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
@@ -115,19 +115,19 @@ export default function Rotate({ title }: ToolComponentProps) {
|
||||
title={title}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('string:rotate.inputTitle')}
|
||||
title={t('rotate.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('string:rotate.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('rotate.resultTitle')} value={result} />
|
||||
}
|
||||
initialValues={initialValues}
|
||||
getGroups={getGroups}
|
||||
toolInfo={{
|
||||
title: t('string:rotate.toolInfo.title'),
|
||||
description: t('string:rotate.toolInfo.description')
|
||||
title: t('rotate.toolInfo.title'),
|
||||
description: t('rotate.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
input={input}
|
||||
|
||||
@@ -133,7 +133,7 @@ easy`,
|
||||
];
|
||||
|
||||
export default function SplitText({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -173,12 +173,12 @@ export default function SplitText({ title }: ToolComponentProps) {
|
||||
input={input}
|
||||
inputComponent={<ToolTextInput value={input} onChange={setInput} />}
|
||||
resultComponent={
|
||||
<ToolTextResult title={t('string:split.resultTitle')} value={result} />
|
||||
<ToolTextResult title={t('split.resultTitle')} value={result} />
|
||||
}
|
||||
initialValues={initialValues}
|
||||
getGroups={({ values, updateField }) => [
|
||||
{
|
||||
title: t('string:split.splitSeparatorOptions'),
|
||||
title: t('split.splitSeparatorOptions'),
|
||||
component: splitOperators.map(({ title, description, type }) => (
|
||||
<RadioWithTextField
|
||||
key={type}
|
||||
@@ -193,7 +193,7 @@ export default function SplitText({ title }: ToolComponentProps) {
|
||||
))
|
||||
},
|
||||
{
|
||||
title: t('string:split.outputSeparatorOptions'),
|
||||
title: t('split.outputSeparatorOptions'),
|
||||
component: outputOptions.map((option) => (
|
||||
<TextFieldWithDesc
|
||||
key={option.accessor}
|
||||
|
||||
@@ -217,7 +217,7 @@ export default function Truncate({
|
||||
title,
|
||||
longDescription
|
||||
}: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -230,38 +230,38 @@ export default function Truncate({
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('string:statistic.delimitersOptions'),
|
||||
title: t('statistic.delimitersOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
value={values.sentenceDelimiters}
|
||||
onOwnChange={(val) => updateField('sentenceDelimiters', val)}
|
||||
placeholder={t('string:statistic.sentenceDelimitersPlaceholder')}
|
||||
description={t('string:statistic.sentenceDelimitersDescription')}
|
||||
placeholder={t('statistic.sentenceDelimitersPlaceholder')}
|
||||
description={t('statistic.sentenceDelimitersDescription')}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
value={values.wordDelimiters}
|
||||
onOwnChange={(val) => updateField('wordDelimiters', val)}
|
||||
placeholder={t('string:statistic.wordDelimitersPlaceholder')}
|
||||
description={t('string:statistic.wordDelimitersDescription')}
|
||||
placeholder={t('statistic.wordDelimitersPlaceholder')}
|
||||
description={t('statistic.wordDelimitersDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('string:statistic.statisticsOptions'),
|
||||
title: t('statistic.statisticsOptions'),
|
||||
component: (
|
||||
<Box>
|
||||
<CheckboxWithDesc
|
||||
checked={values.wordCount}
|
||||
onChange={(value) => updateField('wordCount', value)}
|
||||
title={t('string:statistic.wordFrequencyAnalysis')}
|
||||
description={t('string:statistic.wordFrequencyAnalysisDescription')}
|
||||
title={t('statistic.wordFrequencyAnalysis')}
|
||||
description={t('statistic.wordFrequencyAnalysisDescription')}
|
||||
/>
|
||||
<CheckboxWithDesc
|
||||
checked={values.characterCount}
|
||||
onChange={(value) => updateField('characterCount', value)}
|
||||
title={t('string:statistic.characterFrequencyAnalysis')}
|
||||
title={t('statistic.characterFrequencyAnalysis')}
|
||||
description={t(
|
||||
'string:statistic.characterFrequencyAnalysisDescription'
|
||||
)}
|
||||
@@ -269,8 +269,8 @@ export default function Truncate({
|
||||
<CheckboxWithDesc
|
||||
checked={values.emptyLines}
|
||||
onChange={(value) => updateField('emptyLines', value)}
|
||||
title={t('string:statistic.includeEmptyLines')}
|
||||
description={t('string:statistic.includeEmptyLinesDescription')}
|
||||
title={t('statistic.includeEmptyLines')}
|
||||
description={t('statistic.includeEmptyLinesDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
@@ -287,19 +287,16 @@ export default function Truncate({
|
||||
setInput={setInput}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('string:statistic.inputTitle')}
|
||||
title={t('statistic.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('string:statistic.resultTitle')}
|
||||
value={result}
|
||||
/>
|
||||
<ToolTextResult title={t('statistic.resultTitle')} value={result} />
|
||||
}
|
||||
toolInfo={{
|
||||
title: t('string:statistic.toolInfo.title', { title }),
|
||||
title: t('statistic.toolInfo.title', { title }),
|
||||
description: longDescription
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
|
||||
@@ -61,7 +61,7 @@ const exampleCards: CardExampleType<InitialValuesType>[] = [
|
||||
];
|
||||
|
||||
export default function Replacer({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -74,16 +74,16 @@ export default function Replacer({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('string:textReplacer.searchText'),
|
||||
title: t('textReplacer.searchText'),
|
||||
component: (
|
||||
<Box>
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('mode', 'text')}
|
||||
checked={values.mode === 'text'}
|
||||
title={t('string:textReplacer.findPatternInText')}
|
||||
title={t('textReplacer.findPatternInText')}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
description={t('string:textReplacer.searchPatternDescription')}
|
||||
description={t('textReplacer.searchPatternDescription')}
|
||||
value={values.searchValue}
|
||||
onOwnChange={(val) => updateField('searchValue', val)}
|
||||
type={'text'}
|
||||
@@ -91,10 +91,10 @@ export default function Replacer({ title }: ToolComponentProps) {
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('mode', 'regexp')}
|
||||
checked={values.mode === 'regexp'}
|
||||
title={t('string:textReplacer.findPatternUsingRegexp')}
|
||||
title={t('textReplacer.findPatternUsingRegexp')}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
description={t('string:textReplacer.regexpDescription')}
|
||||
description={t('textReplacer.regexpDescription')}
|
||||
value={values.searchRegexp}
|
||||
onOwnChange={(val) => updateField('searchRegexp', val)}
|
||||
type={'text'}
|
||||
@@ -103,12 +103,12 @@ export default function Replacer({ title }: ToolComponentProps) {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('string:textReplacer.replaceText'),
|
||||
title: t('textReplacer.replaceText'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
description={t('string:textReplacer.replacePatternDescription')}
|
||||
placeholder={t('string:textReplacer.newTextPlaceholder')}
|
||||
description={t('textReplacer.replacePatternDescription')}
|
||||
placeholder={t('textReplacer.newTextPlaceholder')}
|
||||
value={values.replaceValue}
|
||||
onOwnChange={(val) => updateField('replaceValue', val)}
|
||||
type={'text'}
|
||||
@@ -128,20 +128,17 @@ export default function Replacer({ title }: ToolComponentProps) {
|
||||
setInput={setInput}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('string:textReplacer.inputTitle')}
|
||||
title={t('textReplacer.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('string:textReplacer.resultTitle')}
|
||||
value={result}
|
||||
/>
|
||||
<ToolTextResult title={t('textReplacer.resultTitle')} value={result} />
|
||||
}
|
||||
toolInfo={{
|
||||
title: t('string:textReplacer.toolInfo.title'),
|
||||
description: t('string:textReplacer.toolInfo.description')
|
||||
title: t('textReplacer.toolInfo.title'),
|
||||
description: t('textReplacer.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
/>
|
||||
|
||||
@@ -12,7 +12,7 @@ const initialValues = {
|
||||
};
|
||||
|
||||
export default function ToMorse() {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
const computeOptions = (optionsValues: typeof initialValues, input: any) => {
|
||||
@@ -22,34 +22,31 @@ export default function ToMorse() {
|
||||
|
||||
return (
|
||||
<ToolContent
|
||||
title={t('string:toMorse.title')}
|
||||
title={t('toMorse.title')}
|
||||
initialValues={initialValues}
|
||||
compute={computeOptions}
|
||||
input={input}
|
||||
setInput={setInput}
|
||||
inputComponent={<ToolTextInput value={input} onChange={setInput} />}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('string:toMorse.resultTitle')}
|
||||
value={result}
|
||||
/>
|
||||
<ToolTextResult title={t('toMorse.resultTitle')} value={result} />
|
||||
}
|
||||
getGroups={({ values, updateField }) => [
|
||||
{
|
||||
title: t('string:toMorse.shortSignal'),
|
||||
title: t('toMorse.shortSignal'),
|
||||
component: (
|
||||
<TextFieldWithDesc
|
||||
description={t('string:toMorse.dotSymbolDescription')}
|
||||
description={t('toMorse.dotSymbolDescription')}
|
||||
value={values.dotSymbol}
|
||||
onOwnChange={(val) => updateField('dotSymbol', val)}
|
||||
/>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('string:toMorse.longSignal'),
|
||||
title: t('toMorse.longSignal'),
|
||||
component: (
|
||||
<TextFieldWithDesc
|
||||
description={t('string:toMorse.dashSymbolDescription')}
|
||||
description={t('toMorse.dashSymbolDescription')}
|
||||
value={values.dashSymbol}
|
||||
onOwnChange={(val) => updateField('dashSymbol', val)}
|
||||
/>
|
||||
|
||||
@@ -68,7 +68,7 @@ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
|
||||
];
|
||||
|
||||
export default function Truncate({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -81,31 +81,31 @@ export default function Truncate({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('string:truncate.truncationSide'),
|
||||
title: t('truncate.truncationSide'),
|
||||
component: (
|
||||
<Box>
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('truncationSide', 'right')}
|
||||
checked={values.truncationSide === 'right'}
|
||||
title={t('string:truncate.rightSideTruncation')}
|
||||
description={t('string:truncate.rightSideDescription')}
|
||||
title={t('truncate.rightSideTruncation')}
|
||||
description={t('truncate.rightSideDescription')}
|
||||
/>
|
||||
<SimpleRadio
|
||||
onClick={() => updateField('truncationSide', 'left')}
|
||||
checked={values.truncationSide === 'left'}
|
||||
title={t('string:truncate.leftSideTruncation')}
|
||||
description={t('string:truncate.leftSideDescription')}
|
||||
title={t('truncate.leftSideTruncation')}
|
||||
description={t('truncate.leftSideDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('string:truncate.lengthAndLines'),
|
||||
title: t('truncate.lengthAndLines'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
description={t('string:truncate.maxLengthDescription')}
|
||||
placeholder={t('string:truncate.numberPlaceholder')}
|
||||
description={t('truncate.maxLengthDescription')}
|
||||
placeholder={t('truncate.numberPlaceholder')}
|
||||
value={values.maxLength}
|
||||
onOwnChange={(val) => updateField('maxLength', val)}
|
||||
type={'number'}
|
||||
@@ -113,25 +113,25 @@ export default function Truncate({ title }: ToolComponentProps) {
|
||||
<CheckboxWithDesc
|
||||
onChange={(val) => updateField('lineByLine', val)}
|
||||
checked={values.lineByLine}
|
||||
title={t('string:truncate.lineByLineTruncating')}
|
||||
description={t('string:truncate.lineByLineDescription')}
|
||||
title={t('truncate.lineByLineTruncating')}
|
||||
description={t('truncate.lineByLineDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('string:truncate.suffixAndAffix'),
|
||||
title: t('truncate.suffixAndAffix'),
|
||||
component: (
|
||||
<Box>
|
||||
<CheckboxWithDesc
|
||||
onChange={(val) => updateField('addIndicator', val)}
|
||||
checked={values.addIndicator}
|
||||
title={t('string:truncate.addTruncationIndicator')}
|
||||
title={t('truncate.addTruncationIndicator')}
|
||||
description={''}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
description={t('string:truncate.indicatorDescription')}
|
||||
placeholder={t('string:truncate.charactersPlaceholder')}
|
||||
description={t('truncate.indicatorDescription')}
|
||||
placeholder={t('truncate.charactersPlaceholder')}
|
||||
value={values.indicator}
|
||||
onOwnChange={(val) => updateField('indicator', val)}
|
||||
type={'text'}
|
||||
@@ -151,20 +151,17 @@ export default function Truncate({ title }: ToolComponentProps) {
|
||||
setInput={setInput}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('string:truncate.inputTitle')}
|
||||
title={t('truncate.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('string:truncate.resultTitle')}
|
||||
value={result}
|
||||
/>
|
||||
<ToolTextResult title={t('truncate.resultTitle')} value={result} />
|
||||
}
|
||||
toolInfo={{
|
||||
title: t('string:truncate.toolInfo.title'),
|
||||
description: t('string:truncate.toolInfo.description')
|
||||
title: t('truncate.toolInfo.title'),
|
||||
description: t('truncate.toolInfo.description')
|
||||
}}
|
||||
exampleCards={exampleCards}
|
||||
/>
|
||||
|
||||
@@ -36,7 +36,7 @@ const exampleCards: CardExampleType<typeof initialValues>[] = [
|
||||
];
|
||||
|
||||
export default function Uppercase({ title }: ToolComponentProps) {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation('string');
|
||||
const [input, setInput] = useState<string>('');
|
||||
const [result, setResult] = useState<string>('');
|
||||
|
||||
@@ -57,16 +57,13 @@ export default function Uppercase({ title }: ToolComponentProps) {
|
||||
setInput={setInput}
|
||||
inputComponent={
|
||||
<ToolTextInput
|
||||
title={t('string:uppercase.inputTitle')}
|
||||
title={t('uppercase.inputTitle')}
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolTextResult
|
||||
title={t('string:uppercase.resultTitle')}
|
||||
value={result}
|
||||
/>
|
||||
<ToolTextResult title={t('uppercase.resultTitle')} value={result} />
|
||||
}
|
||||
exampleCards={exampleCards}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user