diff --git a/.gitignore b/.gitignore
index f691227..e9d8978 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,3 +42,5 @@ yarn-error.log*
dist.zip
.aider*
.qodo
+
+error.txt
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 1bfb20d..25ae14f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,128 +4,67 @@
-
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
@@ -158,171 +97,178 @@
"state": "OPEN"
}
}
- {
- "prStates": [
+
+}]]>
{
"selectedUrlAndAccountId": {
"url": "https://github.com/iib0011/omni-tools.git",
@@ -354,56 +300,56 @@
- {
+ "keyToString": {
+ "ASKED_ADD_EXTERNAL_FILES": "true",
+ "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
+ "Docker.Dockerfile build.executor": "Run",
+ "Docker.Dockerfile.executor": "Run",
+ "Playwright.Create transparent PNG.should make png color transparent.executor": "Run",
+ "Playwright.JoinText Component.executor": "Run",
+ "Playwright.JoinText Component.should merge text pieces with specified join character.executor": "Run",
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.git.unshallow": "true",
+ "Vitest.compute function (1).executor": "Run",
+ "Vitest.compute function.executor": "Run",
+ "Vitest.mergeText.executor": "Run",
+ "Vitest.mergeText.should merge lines and preserve blank lines when deleteBlankLines is false.executor": "Run",
+ "Vitest.mergeText.should merge lines, preserve blank lines and trailing spaces when both deleteBlankLines and deleteTrailingSpaces are false.executor": "Run",
+ "Vitest.parsePageRanges.executor": "Run",
+ "Vitest.removeDuplicateLines function.executor": "Run",
+ "Vitest.removeDuplicateLines function.newlines option.executor": "Run",
+ "Vitest.removeDuplicateLines function.newlines option.should filter newlines when newlines is set to filter.executor": "Run",
+ "Vitest.replaceText function (regexp mode).should return the original text when passed an invalid regexp.executor": "Run",
+ "Vitest.replaceText function.executor": "Run",
+ "Vitest.timeBetweenDates.executor": "Run",
+ "git-widget-placeholder": "#190 on fork/AshAnand34/en-hi-translation",
+ "ignore.virus.scanning.warn.message": "true",
+ "kotlin-language-version-configured": "true",
+ "last_opened_file_path": "C:/Users/Ibrahima/IdeaProjects/omni-tools/src",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "npm.build.executor": "Run",
+ "npm.dev.executor": "Run",
+ "npm.lint.executor": "Run",
+ "npm.prebuild.executor": "Run",
+ "npm.script:create:tool.executor": "Run",
+ "npm.test.executor": "Run",
+ "npm.test:e2e.executor": "Run",
+ "npm.test:e2e:run.executor": "Run",
+ "prettierjs.PrettierConfiguration.Package": "C:\\Users\\Ibrahima\\IdeaProjects\\omni-tools\\node_modules\\prettier",
+ "project.structure.last.edited": "Problems",
+ "project.structure.proportion": "0.0",
+ "project.structure.side.proportion": "0.2",
+ "settings.editor.selected.configurable": "refactai_advanced_settings",
+ "ts.external.directory.path": "C:\\Users\\Ibrahima\\IdeaProjects\\omni-tools\\node_modules\\typescript\\lib",
+ "vue.rearranger.settings.migration": "true"
}
-}]]>
+}
+
-
-
+
@@ -620,14 +566,7 @@
-
-
-
- 1743022260639
-
-
-
- 1743022260639
+
@@ -1013,11 +952,481 @@
1752158119802
-
+
+
+ 1752402313190
+
+
+
+ 1752402313191
+
+
+
@@ -1064,7 +1473,6 @@
-
@@ -1085,7 +1493,8 @@
-
+
+
false
diff --git a/@types/i18n.d.ts b/@types/i18n.d.ts
new file mode 100644
index 0000000..7238ada
--- /dev/null
+++ b/@types/i18n.d.ts
@@ -0,0 +1,33 @@
+// types/i18next.d.ts
+import 'i18next';
+import enGlobal from '../src/i18n/en.json';
+import enList from '../src/pages/tools/list/i18n/en.json';
+import enString from '../src/pages/tools/string/i18n/en.json';
+import enCsv from '../src/pages/tools/csv/i18n/en.json';
+import enJson from '../src/pages/tools/json/i18n/en.json';
+import enPdf from '../src/pages/tools/pdf/i18n/en.json';
+import enImage from '../src/pages/tools/image/i18n/en.json';
+import enAudio from '../src/pages/tools/audio/i18n/en.json';
+import enVideo from '../src/pages/tools/video/i18n/en.json';
+import enNumber from '../src/pages/tools/number/i18n/en.json';
+import enTime from '../src/pages/tools/time/i18n/en.json';
+import enXml from '../src/pages/tools/xml/i18n/en.json';
+
+declare module 'i18next' {
+ interface CustomTypeOptions {
+ resources: {
+ translation: typeof enGlobal;
+ list: typeof enList;
+ string: typeof enString;
+ csv: typeof enCsv;
+ json: typeof enJson;
+ pdf: typeof enPdf;
+ image: typeof enImage;
+ audio: typeof enAudio;
+ video: typeof enVideo;
+ number: typeof enNumber;
+ time: typeof enTime;
+ xml: typeof enXml;
+ };
+ }
+}
diff --git a/src/components/App.tsx b/src/components/App.tsx
index 69d4d36..b71abd8 100644
--- a/src/components/App.tsx
+++ b/src/components/App.tsx
@@ -10,6 +10,8 @@ import { tools } from '../tools';
import './index.css';
import { darkTheme, lightTheme } from '../config/muiConfig';
import ScrollToTopButton from './ScrollToTopButton';
+import { I18nextProvider } from 'react-i18next';
+import i18n from '../i18n';
export type Mode = 'dark' | 'light' | 'system';
@@ -44,32 +46,34 @@ function App() {
}, []);
return (
-
-
-
-
-
- {
- setMode((prev) => nextMode(prev));
- localStorage.setItem('theme', nextMode(mode));
- }}
- />
- }>
-
-
-
-
-
-
-
+
+
+
+
+
+
+ {
+ setMode((prev) => nextMode(prev));
+ localStorage.setItem('theme', nextMode(mode));
+ }}
+ />
+ }>
+
+
+
+
+
+
+
+
);
}
diff --git a/src/i18n/index.ts b/src/i18n/index.ts
index 9f41cf4..dd54037 100644
--- a/src/i18n/index.ts
+++ b/src/i18n/index.ts
@@ -65,7 +65,7 @@ const resources = {
};
i18n
- .use(Backend)
+ // .use(Backend)
.use(initReactI18next)
.init({
resources,
diff --git a/src/index.tsx b/src/index.tsx
index 6d6a671..5e897af 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,7 +1,6 @@
import { createRoot } from 'react-dom/client';
import 'tailwindcss/tailwind.css';
import App from 'components/App';
-import './i18n';
const container = document.getElementById('root') as HTMLDivElement;
const root = createRoot(container);
diff --git a/src/pages/tools/audio/change-speed/index.tsx b/src/pages/tools/audio/change-speed/index.tsx
index 248db62..bb556b3 100644
--- a/src/pages/tools/audio/change-speed/index.tsx
+++ b/src/pages/tools/audio/change-speed/index.tsx
@@ -26,7 +26,7 @@ export default function ChangeSpeed({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('audio');
const [input, setInput] = useState(null);
const [result, setResult] = useState(null);
const [loading, setLoading] = useState(false);
@@ -51,20 +51,20 @@ export default function ChangeSpeed({
updateField
}) => [
{
- title: t('audio:changeSpeed.newAudioSpeed'),
+ title: t('changeSpeed.newAudioSpeed'),
component: (
updateField('newSpeed', Number(val))}
- description={t('audio:changeSpeed.speedDescription')}
+ description={t('changeSpeed.speedDescription')}
type="number"
/>
)
},
{
- title: t('audio:changeSpeed.outputFormat'),
+ title: t('changeSpeed.outputFormat'),
component: (
}
resultComponent={
loading ? (
) : (
@@ -121,7 +121,7 @@ export default function ChangeSpeed({
setInput={setInput}
compute={compute}
toolInfo={{
- title: t('audio:changeSpeed.toolInfo.title', { title }),
+ title: t('changeSpeed.toolInfo.title', { title }),
description: longDescription
}}
/>
diff --git a/src/pages/tools/audio/extract-audio/index.tsx b/src/pages/tools/audio/extract-audio/index.tsx
index 8f29eee..e54e290 100644
--- a/src/pages/tools/audio/extract-audio/index.tsx
+++ b/src/pages/tools/audio/extract-audio/index.tsx
@@ -18,7 +18,7 @@ export default function ExtractAudio({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('audio');
const [file, setFile] = useState(null);
const [audioFile, setAudioFile] = useState(null);
const [loading, setLoading] = useState(false);
@@ -29,7 +29,7 @@ export default function ExtractAudio({
}) => {
return [
{
- title: t('audio:extractAudio.outputFormat'),
+ title: t('extractAudio.outputFormat'),
component: (
)
@@ -71,19 +71,19 @@ export default function ExtractAudio({
}
resultComponent={
loading ? (
) : (
)
@@ -92,7 +92,7 @@ export default function ExtractAudio({
getGroups={getGroups}
compute={compute}
toolInfo={{
- title: t('audio:extractAudio.toolInfo.title', { title }),
+ title: t('extractAudio.toolInfo.title', { title }),
description: longDescription
}}
setInput={setFile}
diff --git a/src/pages/tools/csv/csv-to-json/index.tsx b/src/pages/tools/csv/csv-to-json/index.tsx
index 336c248..8f4e4cc 100644
--- a/src/pages/tools/csv/csv-to-json/index.tsx
+++ b/src/pages/tools/csv/csv-to-json/index.tsx
@@ -113,7 +113,7 @@ id,name,active
];
export default function CsvToJson({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('csv');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -149,35 +149,35 @@ export default function CsvToJson({ title }: ToolComponentProps) {
exampleCards={exampleCards}
inputComponent={
}
resultComponent={
}
getGroups={({ values, updateField }) => [
{
- title: t('csv:csvToJson.inputCsvFormat'),
+ title: t('csvToJson.inputCsvFormat'),
component: (
updateField('delimiter', val)}
/>
updateField('quote', val)}
value={values.quote}
/>
updateField('comment', val)}
/>
@@ -185,26 +185,26 @@ export default function CsvToJson({ title }: ToolComponentProps) {
)
},
{
- title: t('csv:csvToJson.conversionOptions'),
+ title: t('csvToJson.conversionOptions'),
component: (
updateField('useHeaders', value)}
- title={t('csv:csvToJson.useHeaders')}
- description={t('csv:csvToJson.useHeadersDescription')}
+ title={t('csvToJson.useHeaders')}
+ description={t('csvToJson.useHeadersDescription')}
/>
updateField('skipEmptyLines', value)}
- title={t('csv:csvToJson.skipEmptyLines')}
- description={t('csv:csvToJson.skipEmptyLinesDescription')}
+ title={t('csvToJson.skipEmptyLines')}
+ description={t('csvToJson.skipEmptyLinesDescription')}
/>
updateField('dynamicTypes', value)}
- title={t('csv:csvToJson.dynamicTypes')}
- description={t('csv:csvToJson.dynamicTypesDescription')}
+ title={t('csvToJson.dynamicTypes')}
+ description={t('csvToJson.dynamicTypesDescription')}
/>
)
diff --git a/src/pages/tools/csv/find-incomplete-csv-records/index.tsx b/src/pages/tools/csv/find-incomplete-csv-records/index.tsx
index 65ef993..953adc5 100644
--- a/src/pages/tools/csv/find-incomplete-csv-records/index.tsx
+++ b/src/pages/tools/csv/find-incomplete-csv-records/index.tsx
@@ -104,7 +104,7 @@ export default function FindIncompleteCsvRecords({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('csv');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -117,7 +117,7 @@ export default function FindIncompleteCsvRecords({
updateField
}) => [
{
- title: t('csv:findIncompleteCsvRecords.csvInputOptions'),
+ title: t('findIncompleteCsvRecords.csvInputOptions'),
component: (
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({
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({
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={
}
resultComponent={
}
@@ -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
}}
/>
diff --git a/src/pages/tools/csv/insert-csv-columns/index.tsx b/src/pages/tools/csv/insert-csv-columns/index.tsx
index eea2ce9..cb7b03d 100644
--- a/src/pages/tools/csv/insert-csv-columns/index.tsx
+++ b/src/pages/tools/csv/insert-csv-columns/index.tsx
@@ -123,7 +123,7 @@ export default function InsertCsvColumns({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('csv');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -145,7 +145,7 @@ export default function InsertCsvColumns({
updateField
}) => [
{
- title: t('csv:insertCsvColumns.csvToInsert'),
+ title: t('insertCsvColumns.csvToInsert'),
component: (
updateField('csvToInsert', val)}
- title={t('csv:insertCsvColumns.csvSeparator')}
- description={t('csv:insertCsvColumns.csvToInsertDescription')}
+ title={t('insertCsvColumns.csvSeparator')}
+ description={t('insertCsvColumns.csvToInsertDescription')}
/>
)
},
{
- title: t('csv:insertCsvColumns.csvOptions'),
+ title: t('insertCsvColumns.csvOptions'),
component: (
updateField('separator', val)}
- description={t('csv:insertCsvColumns.separatorDescription')}
+ description={t('insertCsvColumns.separatorDescription')}
/>
updateField('quoteChar', val)}
- description={t('csv:insertCsvColumns.quoteCharDescription')}
+ description={t('insertCsvColumns.quoteCharDescription')}
/>
updateField('commentCharacter', val)}
- description={t('csv:insertCsvColumns.commentCharacterDescription')}
+ description={t('insertCsvColumns.commentCharacterDescription')}
/>
{values.customFill && (
updateField('customFillValue', val)}
- description={t('csv:insertCsvColumns.customFillValueDescription')}
+ description={t('insertCsvColumns.customFillValueDescription')}
/>
)}
)
},
{
- title: t('csv:insertCsvColumns.positionOptions'),
+ title: t('insertCsvColumns.positionOptions'),
component: (
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={
}
resultComponent={
@@ -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}
/>
diff --git a/src/pages/tools/image/generic/resize/index.tsx b/src/pages/tools/image/generic/resize/index.tsx
index d8b56ab..1e7d592 100644
--- a/src/pages/tools/image/generic/resize/index.tsx
+++ b/src/pages/tools/image/generic/resize/index.tsx
@@ -46,7 +46,7 @@ const validationSchema = Yup.object({
});
export default function ResizeImage({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('image');
const [input, setInput] = useState(null);
const [result, setResult] = useState(null);
@@ -60,20 +60,20 @@ export default function ResizeImage({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('image:resize.resizeMethod'),
+ title: t('resize.resizeMethod'),
component: (
updateField('resizeMethod', 'pixels')}
checked={values.resizeMethod === 'pixels'}
- description={t('image:resize.resizeByPixelsDescription')}
- title={t('image:resize.resizeByPixels')}
+ description={t('resize.resizeByPixelsDescription')}
+ title={t('resize.resizeByPixels')}
/>
updateField('resizeMethod', 'percentage')}
checked={values.resizeMethod === 'percentage'}
- description={t('image:resize.resizeByPercentageDescription')}
- title={t('image:resize.resizeByPercentage')}
+ description={t('resize.resizeByPercentageDescription')}
+ title={t('resize.resizeByPercentage')}
/>
)
@@ -81,7 +81,7 @@ export default function ResizeImage({ title }: ToolComponentProps) {
...(values.resizeMethod === 'pixels'
? [
{
- title: t('image:resize.dimensionType'),
+ title: t('resize.dimensionType'),
component: (
updateField('maintainAspectRatio', value)
}
- description={t('image:resize.maintainAspectRatioDescription')}
- title={t('image:resize.maintainAspectRatio')}
+ description={t('resize.maintainAspectRatioDescription')}
+ title={t('resize.maintainAspectRatio')}
/>
{values.maintainAspectRatio && (
updateField('dimensionType', 'width')}
checked={values.dimensionType === 'width'}
- description={t('image:resize.setWidthDescription')}
- title={t('image:resize.setWidth')}
+ description={t('resize.setWidthDescription')}
+ title={t('resize.setWidth')}
/>
updateField('dimensionType', 'height')}
checked={values.dimensionType === 'height'}
- description={t('image:resize.setHeightDescription')}
- title={t('image:resize.setHeight')}
+ description={t('resize.setHeightDescription')}
+ title={t('resize.setHeight')}
/>
)}
updateField('width', val)}
- description={t('image:resize.widthDescription')}
+ description={t('resize.widthDescription')}
disabled={
values.maintainAspectRatio &&
values.dimensionType === 'height'
@@ -125,7 +125,7 @@ export default function ResizeImage({ title }: ToolComponentProps) {
updateField('height', val)}
- description={t('image:resize.heightDescription')}
+ description={t('resize.heightDescription')}
disabled={
values.maintainAspectRatio &&
values.dimensionType === 'width'
@@ -142,13 +142,13 @@ export default function ResizeImage({ title }: ToolComponentProps) {
]
: [
{
- title: t('image:resize.percentage'),
+ title: t('resize.percentage'),
component: (
updateField('percentage', val)}
- description={t('image:resize.percentageDescription')}
+ description={t('resize.percentageDescription')}
inputProps={{
'data-testid': 'percentage-input',
type: 'number',
@@ -175,19 +175,19 @@ export default function ResizeImage({ title }: ToolComponentProps) {
value={input}
onChange={setInput}
accept={['image/jpeg', 'image/png', 'image/svg+xml', 'image/gif']}
- title={t('image:resize.inputTitle')}
+ title={t('resize.inputTitle')}
/>
}
resultComponent={
}
toolInfo={{
- title: t('image:resize.toolInfo.title'),
- description: t('image:resize.toolInfo.description')
+ title: t('resize.toolInfo.title'),
+ description: t('resize.toolInfo.description')
}}
/>
);
diff --git a/src/pages/tools/json/minify/index.tsx b/src/pages/tools/json/minify/index.tsx
index 55eb90d..69c0646 100644
--- a/src/pages/tools/json/minify/index.tsx
+++ b/src/pages/tools/json/minify/index.tsx
@@ -48,7 +48,7 @@ const exampleCards: CardExampleType[] = [
];
export default function MinifyJson({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('json');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -61,14 +61,14 @@ export default function MinifyJson({ title }: ToolComponentProps) {
title={title}
inputComponent={
}
resultComponent={
@@ -76,8 +76,8 @@ export default function MinifyJson({ title }: ToolComponentProps) {
initialValues={initialValues}
getGroups={null}
toolInfo={{
- title: t('json:minify.toolInfo.title'),
- description: t('json:minify.toolInfo.description')
+ title: t('minify.toolInfo.title'),
+ description: t('minify.toolInfo.description')
}}
exampleCards={exampleCards}
input={input}
diff --git a/src/pages/tools/json/prettify/index.tsx b/src/pages/tools/json/prettify/index.tsx
index c183aa3..c24b825 100644
--- a/src/pages/tools/json/prettify/index.tsx
+++ b/src/pages/tools/json/prettify/index.tsx
@@ -116,7 +116,7 @@ const exampleCards: CardExampleType[] = [
];
export default function PrettifyJson({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('json');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -131,14 +131,14 @@ export default function PrettifyJson({ title }: ToolComponentProps) {
input={input}
inputComponent={
}
resultComponent={
@@ -146,14 +146,14 @@ export default function PrettifyJson({ title }: ToolComponentProps) {
initialValues={initialValues}
getGroups={({ values, updateField }) => [
{
- title: t('json:prettify.indentation'),
+ title: t('prettify.indentation'),
component: (
updateField('indentationType', 'space')}
onTextChange={(val) =>
@@ -163,8 +163,8 @@ export default function PrettifyJson({ title }: ToolComponentProps) {
updateField('indentationType', 'tab')}
checked={values.indentationType === 'tab'}
- description={t('json:prettify.useTabsDescription')}
- title={t('json:prettify.useTabs')}
+ description={t('prettify.useTabsDescription')}
+ title={t('prettify.useTabs')}
/>
)
@@ -174,8 +174,8 @@ export default function PrettifyJson({ title }: ToolComponentProps) {
setInput={setInput}
exampleCards={exampleCards}
toolInfo={{
- title: t('json:prettify.toolInfo.title'),
- description: t('json:prettify.toolInfo.description')
+ title: t('prettify.toolInfo.title'),
+ description: t('prettify.toolInfo.description')
}}
/>
);
diff --git a/src/pages/tools/json/validateJson/index.tsx b/src/pages/tools/json/validateJson/index.tsx
index 600701b..7642b59 100644
--- a/src/pages/tools/json/validateJson/index.tsx
+++ b/src/pages/tools/json/validateJson/index.tsx
@@ -47,7 +47,7 @@ const exampleCards: CardExampleType<{}>[] = [
];
export default function ValidateJson({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('json');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -55,9 +55,9 @@ export default function ValidateJson({ title }: ToolComponentProps) {
const { valid, error } = validateJson(input);
if (valid) {
- setResult(t('json:validateJson.validJson'));
+ setResult(t('validateJson.validJson'));
} else {
- setResult(t('json:validateJson.invalidJson', { error }));
+ setResult(t('validateJson.invalidJson', { error }));
}
};
@@ -66,22 +66,19 @@ export default function ValidateJson({ title }: ToolComponentProps) {
title={title}
inputComponent={
}
resultComponent={
-
+
}
initialValues={{}}
getGroups={null}
toolInfo={{
- title: t('json:validateJson.toolInfo.title'),
- description: t('json:validateJson.toolInfo.description')
+ title: t('validateJson.toolInfo.title'),
+ description: t('validateJson.toolInfo.description')
}}
exampleCards={exampleCards}
input={input}
diff --git a/src/pages/tools/list/duplicate/index.tsx b/src/pages/tools/list/duplicate/index.tsx
index a016fc8..ee0e802 100644
--- a/src/pages/tools/list/duplicate/index.tsx
+++ b/src/pages/tools/list/duplicate/index.tsx
@@ -102,7 +102,7 @@ const exampleCards: CardExampleType[] = [
];
export default function Duplicate({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('list');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -136,53 +136,53 @@ export default function Duplicate({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('list:duplicate.splitOptions'),
+ title: t('duplicate.splitOptions'),
component: (
updateField('splitOperatorType', 'symbol')}
checked={values.splitOperatorType === 'symbol'}
- title={t('list:duplicate.splitBySymbol')}
+ title={t('duplicate.splitBySymbol')}
/>
updateField('splitOperatorType', 'regex')}
checked={values.splitOperatorType === 'regex'}
- title={t('list:duplicate.splitByRegex')}
+ title={t('duplicate.splitByRegex')}
/>
updateField('splitSeparator', val)}
- description={t('list:duplicate.splitSeparatorDescription')}
+ description={t('duplicate.splitSeparatorDescription')}
/>
updateField('joinSeparator', val)}
- description={t('list:duplicate.joinSeparatorDescription')}
+ description={t('duplicate.joinSeparatorDescription')}
/>
)
},
{
- title: t('list:duplicate.duplicationOptions'),
+ title: t('duplicate.duplicationOptions'),
component: (
updateField('copy', val)}
- description={t('list:duplicate.copyDescription')}
+ description={t('duplicate.copyDescription')}
type="number"
/>
updateField('concatenate', checked)}
- description={t('list:duplicate.concatenateDescription')}
+ description={t('duplicate.concatenateDescription')}
/>
updateField('reverse', checked)}
- description={t('list:duplicate.reverseDescription')}
+ description={t('duplicate.reverseDescription')}
/>
)
@@ -194,23 +194,20 @@ export default function Duplicate({ title }: ToolComponentProps) {
title={title}
inputComponent={
}
resultComponent={
-
+
}
initialValues={initialValues}
getGroups={getGroups}
validationSchema={validationSchema}
toolInfo={{
- title: t('list:duplicate.toolInfo.title'),
- description: t('list:duplicate.toolInfo.description')
+ title: t('duplicate.toolInfo.title'),
+ description: t('duplicate.toolInfo.description')
}}
exampleCards={exampleCards}
input={input}
diff --git a/src/pages/tools/list/find-unique/index.tsx b/src/pages/tools/list/find-unique/index.tsx
index d2d1921..89af8da 100644
--- a/src/pages/tools/list/find-unique/index.tsx
+++ b/src/pages/tools/list/find-unique/index.tsx
@@ -36,7 +36,7 @@ const splitOperators: {
];
export default function FindUnique() {
- const { t } = useTranslation();
+ const { t } = useTranslation('list');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
const compute = (optionsValues: typeof initialValues, input: any) => {
@@ -66,27 +66,24 @@ export default function FindUnique() {
return (
}
resultComponent={
-
+
}
getGroups={({ values, updateField }) => [
{
- title: t('list:findUnique.inputListDelimiter'),
+ title: t('findUnique.inputListDelimiter'),
component: (
{splitOperators.map(({ title, description, type }) => (
@@ -99,7 +96,7 @@ export default function FindUnique() {
/>
))}
updateField('splitSeparator', val)}
/>
@@ -107,7 +104,7 @@ export default function FindUnique() {
)
},
{
- title: t('list:findUnique.outputListDelimiter'),
+ title: t('findUnique.outputListDelimiter'),
component: (
updateField('joinSeparator', value)}
/>
updateField('trimItems', value)}
/>
updateField('deleteEmptyItems', value)}
/>
@@ -130,20 +127,20 @@ export default function FindUnique() {
)
},
{
- title: t('list:findUnique.uniqueItemOptions'),
+ title: t('findUnique.uniqueItemOptions'),
component: (
updateField('absolutelyUnique', value)}
/>
updateField('caseSensitive', value)}
/>
diff --git a/src/pages/tools/list/group/index.tsx b/src/pages/tools/list/group/index.tsx
index e444af6..7f8ae57 100644
--- a/src/pages/tools/list/group/index.tsx
+++ b/src/pages/tools/list/group/index.tsx
@@ -41,7 +41,7 @@ const splitOperators: {
];
export default function FindUnique({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('list');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
const compute = (optionsValues: typeof initialValues, input: any) => {
@@ -81,18 +81,18 @@ export default function FindUnique({ title }: ToolComponentProps) {
input={input}
inputComponent={
}
resultComponent={
-
+
}
initialValues={initialValues}
getGroups={({ values, updateField }) => [
{
- title: t('list:group.inputItemSeparator'),
+ title: t('group.inputItemSeparator'),
component: (
{splitOperators.map(({ title, description, type }) => (
@@ -107,7 +107,7 @@ export default function FindUnique({ title }: ToolComponentProps) {
/>
))}
updateField('splitSeparator', val)}
/>
@@ -115,12 +115,12 @@ export default function FindUnique({ title }: ToolComponentProps) {
)
},
{
- title: t('list:group.groupSizeAndSeparators'),
+ title: t('group.groupSizeAndSeparators'),
component: (
updateField('groupNumber', formatNumber(value, 1))
@@ -128,46 +128,46 @@ export default function FindUnique({ title }: ToolComponentProps) {
/>
updateField('itemSeparator', value)}
/>
updateField('groupSeparator', value)}
/>
updateField('leftWrap', value)}
/>
updateField('rightWrap', value)}
/>
)
},
{
- title: t('list:group.emptyItemsAndPadding'),
+ title: t('group.emptyItemsAndPadding'),
component: (
updateField('deleteEmptyItems', value)}
/>
updateField('padNonFullGroup', value)}
/>
updateField('paddingChar', value)}
/>
diff --git a/src/pages/tools/list/i18n/en.json b/src/pages/tools/list/i18n/en.json
index abde519..0903744 100644
--- a/src/pages/tools/list/i18n/en.json
+++ b/src/pages/tools/list/i18n/en.json
@@ -1,24 +1,4 @@
{
- "group": {
- "title": "Group List",
- "description": "Group list items by common properties.",
- "inputTitle": "Input list",
- "resultTitle": "Grouped list",
- "groupingOptions": "Grouping Options",
- "groupByDescription": "Choose how to group the list items",
- "groupByValue": "Group by Value",
- "groupByValueDescription": "Group items that have the same value",
- "groupByLength": "Group by Length",
- "groupByLengthDescription": "Group items by their character length",
- "groupByFirstChar": "Group by First Character",
- "groupByFirstCharDescription": "Group items by their first character",
- "groupByLastChar": "Group by Last Character",
- "groupByLastCharDescription": "Group items by their last character",
- "toolInfo": {
- "title": "Group List",
- "description": "This tool allows you to group list items by various criteria such as value, length, or character position. It's useful for organizing and categorizing data."
- }
- },
"reverse": {
"title": "Reverse List",
"description": "Reverse the order of items in a list.",
@@ -32,53 +12,22 @@
"description": "This tool allows you to reverse the order of items in a list. You can reverse the entire list or each line separately."
}
},
- "sort": {
- "title": "Sort List",
- "description": "Sort list items in ascending or descending order.",
- "inputTitle": "Input list",
- "resultTitle": "Sorted list",
- "sortOptions": "Sort Options",
- "sortOrder": "Sort Order",
- "ascending": "Ascending",
- "descending": "Descending",
- "sortType": "Sort Type",
- "alphabetical": "Alphabetical",
- "numerical": "Numerical",
- "natural": "Natural",
- "toolInfo": {
- "title": "Sort List",
- "description": "This tool allows you to sort list items in various orders and types. You can sort alphabetically, numerically, or using natural sorting."
- }
- },
- "duplicate": {
- "title": "Find Duplicates",
- "description": "Find and remove duplicate items from a list.",
- "inputTitle": "Input list",
- "resultTitle": "Unique list",
- "duplicateOptions": "Duplicate Options",
- "removeDuplicates": "Remove Duplicates",
- "removeDuplicatesDescription": "Remove duplicate items from the list",
- "showDuplicates": "Show Duplicates",
- "showDuplicatesDescription": "Show only the duplicate items",
- "toolInfo": {
- "title": "Find Duplicates",
- "description": "This tool allows you to find and handle duplicate items in a list. You can remove duplicates or show only the duplicate items."
- }
- },
"findUnique": {
"title": "Find Unique",
- "description": "Find unique items in a list.",
- "inputTitle": "Input list",
- "resultTitle": "Unique items",
- "uniqueOptions": "Unique Options",
- "showUnique": "Show Unique",
- "showUniqueDescription": "Show only unique items",
- "showDuplicates": "Show Duplicates",
- "showDuplicatesDescription": "Show only duplicate items",
- "toolInfo": {
- "title": "Find Unique",
- "description": "This tool allows you to find unique items in a list. You can show unique items or duplicate items."
- }
+ "inputTitle": "Input List",
+ "resultTitle": "Unique Items",
+ "inputListDelimiter": "Input List Delimiter",
+ "delimiterDescription": "Set a delimiting symbol or regular expression.",
+ "outputListDelimiter": "Output List Delimiter",
+ "trimItems": "Trim List Items",
+ "trimItemsDescription": "Remove leading and trailing spaces before comparing items.",
+ "skipEmptyItems": "Skip Empty Items",
+ "skipEmptyItemsDescription": "Don't include the empty list items in the output.",
+ "uniqueItemOptions": "Unique Item Options",
+ "findAbsolutelyUniqueItems": "Find Absolutely Unique Items",
+ "findAbsolutelyUniqueItemsDescription": "Display only those items of the list that exist in a single copy.",
+ "caseSensitiveItems": "Case Sensitive Items",
+ "caseSensitiveItemsDescription": "Output items with different case as unique elements in the list."
},
"shuffle": {
"title": "Shuffle List",
@@ -111,5 +60,104 @@
"title": "List Wrapping",
"description": "This tool allows you to add text before and after each item in a list. You can specify different text for the left and right sides, and control how the list is processed. It's useful for adding quotes, brackets, or other formatting to list items, preparing data for different formats, or creating structured text."
}
+ },
+ "sort": {
+ "inputTitle": "Input list",
+ "resultTitle": "Sorted list",
+ "inputItemSeparator": "Input item separator",
+ "splitSeparatorDescription": "Set a delimiting symbol or regular expression.",
+ "splitOperators": {
+ "symbol": {
+ "title": "Use a Symbol for Splitting",
+ "description": "Delimit input list items with a character."
+ },
+ "regex": {
+ "title": "Use a Regex for Splitting",
+ "description": "Delimit input list items with a regular expression."
+ }
+ },
+ "sortMethod": "Sort method",
+ "sortMethodDescription": "Select a sorting method.",
+ "sortOptions": {
+ "alphabetic": "Sort Alphabetically",
+ "numeric": "Sort Numerically",
+ "length": "Sort by Length"
+ },
+ "orderDescription": "Select a sorting order.",
+ "orderOptions": {
+ "increasing": "Increasing order",
+ "decreasing": "Decreasing order"
+ },
+ "caseSensitive": "Case Sensitive Sort",
+ "caseSensitiveDescription": "Sort uppercase and lowercase items separately. Capital letters precede lowercase letters in an ascending list. (Works only in alphabetical sorting mode.)",
+ "sortedItemProperties": "Sorted item properties",
+ "joinSeparatorDescription": "Use this symbol as a joiner between items in a sorted list.",
+ "removeDuplicates": "Remove duplicates",
+ "removeDuplicatesDescription": "Delete duplicate list items."
+ },
+ "group": {
+ "inputTitle": "Input list",
+ "resultTitle": "Grouped items",
+ "inputItemSeparator": "Input Item Separator",
+ "splitSeparatorDescription": "Set a delimiting symbol or regular expression.",
+ "splitOperators": {
+ "symbol": {
+ "title": "Use a Symbol for Splitting",
+ "description": "Delimit input list items with a character."
+ },
+ "regex": {
+ "title": "Use a Regex for Splitting",
+ "description": "Delimit input list items with a regular expression."
+ }
+ },
+ "groupSizeAndSeparators": "Group Size and Separators",
+ "groupNumberDescription": "Number of items in a group",
+ "itemSeparatorDescription": "Item separator character",
+ "groupSeparatorDescription": "Group separator character",
+ "leftWrapDescription": "Group's left wrap symbol.",
+ "rightWrapDescription": "Group's right wrap symbol.",
+ "emptyItemsAndPadding": "Empty Items and Padding",
+ "deleteEmptyItems": "Delete Empty Items",
+ "deleteEmptyItemsDescription": "Ignore empty items and don't include them in the groups.",
+ "padNonFullGroups": "Pad Non-full Groups",
+ "padNonFullGroupsDescription": "Fill non-full groups with a custom item (enter below).",
+ "paddingCharDescription": "Use this character or item to pad non-full groups."
+ },
+ "duplicate": {
+ "toolInfo": {
+ "title": "List Duplication",
+ "description": "This tool allows you to duplicate items in a list. You can specify the number of copies (including fractional values), control whether items are concatenated or interweaved, and even reverse the duplicated items. It's useful for creating repeated patterns, generating test data, or expanding lists with predictable content."
+ },
+ "inputTitle": "Input List",
+ "resultTitle": "Duplicated List",
+ "splitOptions": "Split Options",
+ "splitBySymbol": "Split by Symbol",
+ "splitByRegex": "Split by Regular Expression",
+ "splitSeparatorDescription": "Separator to split the list",
+ "joinSeparatorDescription": "Separator to join the duplicated list",
+ "duplicationOptions": "Duplication Options",
+ "copyDescription": "Number of copies (can be fractional)",
+ "concatenate": "Concatenate",
+ "concatenateDescription": "Concatenate copies (if unchecked, items will be interweaved)",
+ "reverse": "Reverse",
+ "reverseDescription": "Reverse the duplicated items",
+ "examples": {
+ "simple": {
+ "title": "Simple duplication",
+ "description": "This example shows how to duplicate a list of words."
+ },
+ "reverse": {
+ "title": "Reverse duplication",
+ "description": "This example shows how to duplicate a list in reverse order."
+ },
+ "interweave": {
+ "title": "Interweaving items",
+ "description": "This example shows how to interweave items instead of concatenating them."
+ },
+ "fractional": {
+ "title": "Fractional duplication",
+ "description": "This example shows how to duplicate a list with a fractional number of copies."
+ }
+ }
}
}
diff --git a/src/pages/tools/list/reverse/index.tsx b/src/pages/tools/list/reverse/index.tsx
index 6a140e1..f8ac241 100644
--- a/src/pages/tools/list/reverse/index.tsx
+++ b/src/pages/tools/list/reverse/index.tsx
@@ -112,7 +112,7 @@ argument`,
];
export default function Reverse({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('list');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -121,7 +121,7 @@ export default function Reverse({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('list:reverse.splitterMode'),
+ title: t('reverse.splitterMode'),
component: (
{splitOperators.map(({ title, description, type }) => (
@@ -137,11 +137,11 @@ export default function Reverse({ title }: ToolComponentProps) {
)
},
{
- title: t('list:reverse.itemSeparator'),
+ title: t('reverse.itemSeparator'),
component: (
updateField('splitSeparator', val)}
/>
@@ -149,11 +149,11 @@ export default function Reverse({ title }: ToolComponentProps) {
)
},
{
- title: t('list:reverse.outputListOptions'),
+ title: t('reverse.outputListOptions'),
component: (
updateField('joinSeparator', val)}
/>
@@ -179,17 +179,17 @@ export default function Reverse({ title }: ToolComponentProps) {
setInput={setInput}
inputComponent={
}
resultComponent={
-
+
}
toolInfo={{
- title: t('list:reverse.toolInfo.title'),
- description: t('list:reverse.toolInfo.description')
+ title: t('reverse.toolInfo.title'),
+ description: t('reverse.toolInfo.description')
}}
exampleCards={exampleCards}
/>
diff --git a/src/pages/tools/list/shuffle/index.tsx b/src/pages/tools/list/shuffle/index.tsx
index e994ccc..34e110c 100644
--- a/src/pages/tools/list/shuffle/index.tsx
+++ b/src/pages/tools/list/shuffle/index.tsx
@@ -33,7 +33,7 @@ const splitOperators: {
];
export default function Shuffle() {
- const { t } = useTranslation();
+ const { t } = useTranslation('list');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
const compute = (optionsValues: typeof initialValues, input: any) => {
@@ -53,24 +53,24 @@ export default function Shuffle() {
return (
}
resultComponent={
-
+
}
getGroups={({ values, updateField }) => [
{
- title: t('list:shuffle.inputListSeparator'),
+ title: t('shuffle.inputListSeparator'),
component: (
{splitOperators.map(({ title, description, type }) => (
@@ -83,7 +83,7 @@ export default function Shuffle() {
/>
))}
updateField('splitSeparator', val)}
/>
@@ -91,11 +91,11 @@ export default function Shuffle() {
)
},
{
- title: t('list:shuffle.shuffledListLength'),
+ title: t('shuffle.shuffledListLength'),
component: (
updateField('length', val)}
/>
@@ -103,13 +103,13 @@ export default function Shuffle() {
)
},
{
- title: t('list:shuffle.shuffledListSeparator'),
+ title: t('shuffle.shuffledListSeparator'),
component: (
updateField('joinSeparator', value)}
- description={t('list:shuffle.joinSeparatorDescription')}
+ description={t('shuffle.joinSeparatorDescription')}
/>
)
diff --git a/src/pages/tools/list/sort/index.tsx b/src/pages/tools/list/sort/index.tsx
index a895fd8..1567e81 100644
--- a/src/pages/tools/list/sort/index.tsx
+++ b/src/pages/tools/list/sort/index.tsx
@@ -37,8 +37,8 @@ const splitOperators: {
}
];
-export default function SplitText({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+export default function SortList({ title }: ToolComponentProps) {
+ const { t } = useTranslation('list');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
const compute = (optionsValues: typeof initialValues, input: any) => {
@@ -72,33 +72,31 @@ export default function SplitText({ title }: ToolComponentProps) {
input={input}
inputComponent={
}
resultComponent={
-
+
}
initialValues={initialValues}
getGroups={({ values, updateField }) => [
{
- title: t('list:sort.inputItemSeparator'),
+ title: t('sort.inputItemSeparator'),
component: (
{splitOperators.map(({ title, description, type }) => (
updateField('splitSeparatorType', type)}
- title={t(`list.sort.splitOperators.${type}.title`)}
- description={t(
- `list.sort.splitOperators.${type}.description`
- )}
+ title={t(`sort.splitOperators.${type}.title`)}
+ description={t(`sort.splitOperators.${type}.description`)}
checked={values.splitSeparatorType === type}
/>
))}
updateField('splitSeparator', val)}
/>
@@ -106,45 +104,45 @@ export default function SplitText({ title }: ToolComponentProps) {
)
},
{
- title: t('list:sort.sortMethod'),
+ title: t('sort.sortMethod'),
component: (
updateField('sortingMethod', value)}
- description={t('list:sort.sortMethodDescription')}
+ description={t('sort.sortMethodDescription')}
/>
{
updateField('increasing', value);
}}
- description={t('list:sort.orderDescription')}
+ description={t('sort.orderDescription')}
/>
updateField('caseSensitive', val)}
/>
@@ -152,17 +150,17 @@ export default function SplitText({ title }: ToolComponentProps) {
)
},
{
- title: t('list:sort.sortedItemProperties'),
+ title: t('sort.sortedItemProperties'),
component: (
updateField('joinSeparator', val)}
/>
updateField('removeDuplicated', val)}
/>
diff --git a/src/pages/tools/list/wrap/index.tsx b/src/pages/tools/list/wrap/index.tsx
index 705dcfe..e616b20 100644
--- a/src/pages/tools/list/wrap/index.tsx
+++ b/src/pages/tools/list/wrap/index.tsx
@@ -86,7 +86,7 @@ const exampleCards: CardExampleType[] = [
];
export default function Wrap({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('list');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -119,50 +119,50 @@ export default function Wrap({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('list:wrap.splitOptions'),
+ title: t('wrap.splitOptions'),
component: (
updateField('splitOperatorType', 'symbol')}
checked={values.splitOperatorType === 'symbol'}
- title={t('list:wrap.splitBySymbol')}
+ title={t('wrap.splitBySymbol')}
/>
updateField('splitOperatorType', 'regex')}
checked={values.splitOperatorType === 'regex'}
- title={t('list:wrap.splitByRegex')}
+ title={t('wrap.splitByRegex')}
/>
updateField('splitSeparator', val)}
- description={t('list:wrap.splitSeparatorDescription')}
+ description={t('wrap.splitSeparatorDescription')}
/>
updateField('joinSeparator', val)}
- description={t('list:wrap.joinSeparatorDescription')}
+ description={t('wrap.joinSeparatorDescription')}
/>
updateField('deleteEmptyItems', checked)}
- title={t('list:wrap.removeEmptyItems')}
+ title={t('wrap.removeEmptyItems')}
/>
)
},
{
- title: t('list:wrap.wrapOptions'),
+ title: t('wrap.wrapOptions'),
component: (
updateField('left', val)}
- description={t('list:wrap.leftTextDescription')}
+ description={t('wrap.leftTextDescription')}
/>
updateField('right', val)}
- description={t('list:wrap.rightTextDescription')}
+ description={t('wrap.rightTextDescription')}
/>
)
@@ -174,20 +174,20 @@ export default function Wrap({ title }: ToolComponentProps) {
title={title}
inputComponent={
}
resultComponent={
-
+
}
initialValues={initialValues}
getGroups={getGroups}
validationSchema={validationSchema}
toolInfo={{
- title: t('list:wrap.toolInfo.title'),
- description: t('list:wrap.toolInfo.description')
+ title: t('wrap.toolInfo.title'),
+ description: t('wrap.toolInfo.description')
}}
exampleCards={exampleCards}
input={input}
diff --git a/src/pages/tools/number/arithmetic-sequence/index.tsx b/src/pages/tools/number/arithmetic-sequence/index.tsx
index 70f3e4a..e7143b3 100644
--- a/src/pages/tools/number/arithmetic-sequence/index.tsx
+++ b/src/pages/tools/number/arithmetic-sequence/index.tsx
@@ -71,7 +71,7 @@ const exampleCards: CardExampleType[] = [
];
export default function ArithmeticSequence({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('number');
const [result, setResult] = useState('');
return (
@@ -80,7 +80,7 @@ export default function ArithmeticSequence({ title }: ToolComponentProps) {
inputComponent={null}
resultComponent={
}
@@ -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: (
updateField('separator', val)}
/>
diff --git a/src/pages/tools/number/generate/index.tsx b/src/pages/tools/number/generate/index.tsx
index 5273141..44158d0 100644
--- a/src/pages/tools/number/generate/index.tsx
+++ b/src/pages/tools/number/generate/index.tsx
@@ -15,7 +15,7 @@ const initialValues = {
};
export default function GenerateNumbers({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('number');
const [result, setResult] = useState('');
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: (
updateField('firstValue', val)}
type={'number'}
/>
updateField('step', val)}
type={'number'}
/>
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: (
updateField('separator', val)}
/>
@@ -73,10 +73,7 @@ export default function GenerateNumbers({ title }: ToolComponentProps) {
]}
compute={compute}
resultComponent={
-
+
}
/>
);
diff --git a/src/pages/tools/number/sum/index.tsx b/src/pages/tools/number/sum/index.tsx
index a8d44f9..6d66182 100644
--- a/src/pages/tools/number/sum/index.tsx
+++ b/src/pages/tools/number/sum/index.tsx
@@ -119,7 +119,7 @@ const exampleCards: CardExampleType[] = [
];
export default function SumNumbers({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('number');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -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: (
updateField('printRunningSum', value)}
/>
@@ -175,13 +175,13 @@ export default function SumNumbers({ title }: ToolComponentProps) {
input={input}
inputComponent={
}
resultComponent={
-
+
}
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}
/>
diff --git a/src/pages/tools/pdf/compress-pdf/index.tsx b/src/pages/tools/pdf/compress-pdf/index.tsx
index 32c712f..53f2731 100644
--- a/src/pages/tools/pdf/compress-pdf/index.tsx
+++ b/src/pages/tools/pdf/compress-pdf/index.tsx
@@ -10,7 +10,7 @@ import ToolFileResult from '@components/result/ToolFileResult';
import SimpleRadio from '@components/options/SimpleRadio';
import { CardExampleType } from '@components/examples/ToolExamples';
import { PDFDocument } from 'pdf-lib';
-import { CustomSnackBarContext } from '@contexts/CustomSnackBarContext';
+import { CustomSnackBarContext } from '../../../../contexts/CustomSnackBarContext';
import { useTranslation } from 'react-i18next';
const initialValues: InitialValuesType = {
@@ -51,7 +51,7 @@ export default function CompressPdf({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('pdf');
const [input, setInput] = useState(null);
const [result, setResult] = useState(null);
const [resultSize, setResultSize] = useState('');
@@ -80,7 +80,7 @@ export default function CompressPdf({
} catch (error) {
console.error('Error getting PDF info:', error);
setFileInfo(null);
- showSnackBar(t('pdf:compressPdf.errorReadingPdf'), 'error');
+ showSnackBar(t('compressPdf.errorReadingPdf'), 'error');
}
};
@@ -112,7 +112,7 @@ export default function CompressPdf({
} catch (error) {
console.error('Error compressing PDF:', error);
showSnackBar(
- t('pdf:compressPdf.errorCompressingPdf', {
+ t('compressPdf.errorCompressingPdf', {
error: error instanceof Error ? error.message : String(error)
}),
'error'
@@ -130,18 +130,18 @@ export default function CompressPdf({
}[] = [
{
value: 'low',
- label: t('pdf:compressPdf.lowCompression'),
- description: t('pdf:compressPdf.lowCompressionDescription')
+ label: t('compressPdf.lowCompression'),
+ description: t('compressPdf.lowCompressionDescription')
},
{
value: 'medium',
- label: t('pdf:compressPdf.mediumCompression'),
- description: t('pdf:compressPdf.mediumCompressionDescription')
+ label: t('compressPdf.mediumCompression'),
+ description: t('compressPdf.mediumCompressionDescription')
},
{
value: 'high',
- label: t('pdf:compressPdf.highCompression'),
- description: t('pdf:compressPdf.highCompressionDescription')
+ label: t('compressPdf.highCompression'),
+ description: t('compressPdf.highCompressionDescription')
}
];
@@ -157,26 +157,26 @@ export default function CompressPdf({
value={input}
onChange={setInput}
accept={['application/pdf']}
- title={t('pdf:compressPdf.inputTitle')}
+ title={t('compressPdf.inputTitle')}
/>
}
resultComponent={
}
getGroups={({ values, updateField }) => [
{
- title: t('pdf:compressPdf.compressionSettings'),
+ title: t('compressPdf.compressionSettings'),
component: (
- {t('pdf:compressPdf.compressionLevel')}
+ {t('compressPdf.compressionLevel')}
{compressionOptions.map((option) => (
@@ -201,16 +201,15 @@ export default function CompressPdf({
}}
>
- {t('pdf:compressPdf.fileSize')}:{' '}
+ {t('compressPdf.fileSize')}:{' '}
{fileInfo.size}
- {t('pdf:compressPdf.pages')}:{' '}
- {fileInfo.pages}
+ {t('compressPdf.pages')}: {fileInfo.pages}
{resultSize && (
- {t('pdf:compressPdf.compressedFileSize')}:{' '}
+ {t('compressPdf.compressedFileSize')}:{' '}
{resultSize}
)}
diff --git a/src/pages/tools/pdf/i18n/en.json b/src/pages/tools/pdf/i18n/en.json
index 92b48da..79218f5 100644
--- a/src/pages/tools/pdf/i18n/en.json
+++ b/src/pages/tools/pdf/i18n/en.json
@@ -15,20 +15,6 @@
"description": "This tool allows you to combine multiple PDF files into a single document. You can choose how to sort the PDFs and the tool will merge them in the specified order."
}
},
- "compressPdf": {
- "title": "Compress PDF",
- "description": "Reduce PDF file size while maintaining quality.",
- "inputTitle": "Input PDF",
- "resultTitle": "Compressed PDF",
- "compressingPdf": "Compressing PDF",
- "compressionOptions": "Compression Options",
- "qualityDescription": "Compression quality (1-100)",
- "qualityPlaceholder": "Quality",
- "toolInfo": {
- "title": "Compress PDF",
- "description": "This tool allows you to compress PDF files to reduce their size while maintaining acceptable quality. You can adjust the compression level to balance between file size and quality."
- }
- },
"splitPdf": {
"title": "Split PDF",
"description": "Extract specific pages from a PDF document.",
@@ -68,5 +54,29 @@
"title": "How to Use the Rotate PDF Tool",
"description": "This tool allows you to rotate pages in a PDF document. You can rotate all pages or specify individual pages to rotate. Choose a rotation angle: 90° Clockwise, 180° (Upside down), or 270° (90° Counter-clockwise). To rotate specific pages, uncheck \"Apply to all pages\" and enter page numbers or ranges separated by commas (e.g., 1,3,5-7)."
}
+ },
+ "compressPdf": {
+ "inputTitle": "Input PDF",
+ "resultTitle": "Compressed PDF",
+ "compressingPdf": "Compressing PDF...",
+
+ "compressionSettings": "Compression Settings",
+ "compressionLevel": "Compression Level",
+
+ "lowCompression": "Low Compression",
+ "lowCompressionDescription": "Slightly reduce file size with minimal quality loss",
+
+ "mediumCompression": "Medium Compression",
+ "mediumCompressionDescription": "Balance between file size and quality",
+
+ "highCompression": "High Compression",
+ "highCompressionDescription": "Maximum file size reduction with some quality loss",
+
+ "fileSize": "Original File Size",
+ "compressedFileSize": "Compressed File Size",
+ "pages": "Number of Pages",
+
+ "errorReadingPdf": "Failed to read PDF file. Please make sure it is a valid PDF.",
+ "errorCompressingPdf": "Failed to compress PDF: {{error}}"
}
}
diff --git a/src/pages/tools/pdf/merge-pdf/index.tsx b/src/pages/tools/pdf/merge-pdf/index.tsx
index 77084e9..9510209 100644
--- a/src/pages/tools/pdf/merge-pdf/index.tsx
+++ b/src/pages/tools/pdf/merge-pdf/index.tsx
@@ -9,7 +9,7 @@ import ToolMultiPdfInput, {
import { useTranslation } from 'react-i18next';
export default function MergePdf({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('pdf');
const [input, setInput] = useState([]);
const [result, setResult] = useState(null);
const [isProcessing, setIsProcessing] = useState(false);
@@ -44,23 +44,23 @@ export default function MergePdf({ title }: ToolComponentProps) {
setInput(pdfInputs);
}}
accept={['application/pdf']}
- title={t('pdf:merge.inputTitle')}
+ title={t('merge.inputTitle')}
type="pdf"
/>
}
getGroups={null}
resultComponent={
}
toolInfo={{
- title: t('pdf:merge.toolInfo.title'),
- description: t('pdf:merge.toolInfo.description')
+ title: t('merge.toolInfo.title'),
+ description: t('merge.toolInfo.description')
}}
/>
);
diff --git a/src/pages/tools/pdf/rotate-pdf/index.tsx b/src/pages/tools/pdf/rotate-pdf/index.tsx
index d95da5d..a262805 100644
--- a/src/pages/tools/pdf/rotate-pdf/index.tsx
+++ b/src/pages/tools/pdf/rotate-pdf/index.tsx
@@ -58,7 +58,7 @@ export default function RotatePdf({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('pdf');
const [input, setInput] = useState(null);
const [result, setResult] = useState(null);
const [isProcessing, setIsProcessing] = useState(false);
@@ -92,7 +92,7 @@ export default function RotatePdf({
if (applyToAllPages) {
setPageRangePreview(
totalPages > 0
- ? t('pdf:rotatePdf.allPagesWillBeRotated', { count: totalPages })
+ ? t('rotatePdf.allPagesWillBeRotated', { count: totalPages })
: ''
);
return;
@@ -105,7 +105,7 @@ export default function RotatePdf({
try {
const count = parsePageRanges(pageRanges, totalPages).length;
- setPageRangePreview(t('pdf:rotatePdf.pagesWillBeRotated', { count }));
+ setPageRangePreview(t('rotatePdf.pagesWillBeRotated', { count }));
} catch (error) {
setPageRangePreview('');
}
@@ -125,9 +125,9 @@ export default function RotatePdf({
}
};
const angleOptions: { value: RotationAngle; label: string }[] = [
- { value: 90, label: t('pdf:rotatePdf.angleOptions.clockwise90') },
- { value: 180, label: t('pdf:rotatePdf.angleOptions.upsideDown180') },
- { value: 270, label: t('pdf:rotatePdf.angleOptions.counterClockwise270') }
+ { value: 90, label: t('rotatePdf.angleOptions.clockwise90') },
+ { value: 180, label: t('rotatePdf.angleOptions.upsideDown180') },
+ { value: 270, label: t('rotatePdf.angleOptions.counterClockwise270') }
];
return (
}
resultComponent={
}
getGroups={({ values, updateField }) => [
{
- title: t('pdf:rotatePdf.rotationSettings'),
+ title: t('rotatePdf.rotationSettings'),
component: (
- {t('pdf:rotatePdf.rotationAngle')}
+ {t('rotatePdf.rotationAngle')}
{angleOptions.map((angleOption) => (
}
- label={t('pdf:rotatePdf.applyToAllPages')}
+ label={t('rotatePdf.applyToAllPages')}
/>
@@ -191,7 +191,7 @@ export default function RotatePdf({
{totalPages > 0 && (
- {t('pdf:rotatePdf.pdfPageCount', { count: totalPages })}
+ {t('rotatePdf.pdfPageCount', { count: totalPages })}
)}
{
updateField('pageRanges', val);
}}
- description={t('pdf:rotatePdf.pageRangesDescription')}
- placeholder={t('pdf:rotatePdf.pageRangesPlaceholder')}
+ description={t('rotatePdf.pageRangesDescription')}
+ placeholder={t('rotatePdf.pageRangesPlaceholder')}
/>
{pageRangePreview && (
);
diff --git a/src/pages/tools/pdf/split-pdf/index.tsx b/src/pages/tools/pdf/split-pdf/index.tsx
index 7a1fa26..85beed0 100644
--- a/src/pages/tools/pdf/split-pdf/index.tsx
+++ b/src/pages/tools/pdf/split-pdf/index.tsx
@@ -49,7 +49,7 @@ const exampleCards: CardExampleType[] = [
];
export default function SplitPdf({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('pdf');
const [input, setInput] = useState(null);
const [result, setResult] = useState(null);
const [isProcessing, setIsProcessing] = useState(false);
@@ -85,7 +85,7 @@ export default function SplitPdf({ title }: ToolComponentProps) {
}
try {
const count = parsePageRanges(pageRanges, totalPages).length;
- setPageRangePreview(t('pdf:splitPdf.pageExtractionPreview', { count }));
+ setPageRangePreview(t('splitPdf.pageExtractionPreview', { count }));
} catch (error) {
setPageRangePreview('');
}
@@ -118,26 +118,26 @@ export default function SplitPdf({ title }: ToolComponentProps) {
value={input}
onChange={setInput}
accept={['application/pdf']}
- title={t('pdf:splitPdf.inputTitle')}
+ title={t('splitPdf.inputTitle')}
/>
}
resultComponent={
}
getGroups={({ values, updateField }) => [
{
- title: t('pdf:splitPdf.pageSelection'),
+ title: t('splitPdf.pageSelection'),
component: (
{totalPages > 0 && (
- {t('pdf:splitPdf.pdfPageCount', { count: totalPages })}
+ {t('splitPdf.pdfPageCount', { count: totalPages })}
)}
{
updateField('pageRanges', val);
}}
- description={t('pdf:splitPdf.pageRangesDescription')}
- placeholder={t('pdf:splitPdf.pageRangesPlaceholder')}
+ description={t('splitPdf.pageRangesDescription')}
+ placeholder={t('splitPdf.pageRangesPlaceholder')}
/>
{pageRangePreview && (
);
diff --git a/src/pages/tools/string/base64/index.tsx b/src/pages/tools/string/base64/index.tsx
index c5e62f2..1a6d208 100644
--- a/src/pages/tools/string/base64/index.tsx
+++ b/src/pages/tools/string/base64/index.tsx
@@ -34,7 +34,7 @@ const exampleCards: CardExampleType[] = [
];
export default function Base64({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('string');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -47,18 +47,18 @@ export default function Base64({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('string:base64.optionsTitle'),
+ title: t('base64.optionsTitle'),
component: (
updateField('mode', 'encode')}
checked={values.mode === 'encode'}
- title={t('string:base64.encode')}
+ title={t('base64.encode')}
/>
updateField('mode', 'decode')}
checked={values.mode === 'decode'}
- title={t('string:base64.decode')}
+ title={t('base64.decode')}
/>
)
@@ -70,19 +70,19 @@ export default function Base64({ title }: ToolComponentProps) {
title={title}
inputComponent={
}
resultComponent={
-
+
}
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}
diff --git a/src/pages/tools/string/join/index.tsx b/src/pages/tools/string/join/index.tsx
index 63b6aed..98089d8 100644
--- a/src/pages/tools/string/join/index.tsx
+++ b/src/pages/tools/string/join/index.tsx
@@ -108,7 +108,7 @@ s
];
export default function JoinText({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('string');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
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: (
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) => (
}
resultComponent={
-
+
}
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}
/>
diff --git a/src/pages/tools/string/quote/index.tsx b/src/pages/tools/string/quote/index.tsx
index 0726dae..64b523c 100644
--- a/src/pages/tools/string/quote/index.tsx
+++ b/src/pages/tools/string/quote/index.tsx
@@ -71,7 +71,7 @@ const exampleCards: CardExampleType[] = [
];
export default function Quote({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('string');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -95,33 +95,33 @@ export default function Quote({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('string:quote.quoteOptions'),
+ title: t('quote.quoteOptions'),
component: (
updateField('leftQuote', val)}
- description={t('string:quote.leftQuoteDescription')}
+ description={t('quote.leftQuoteDescription')}
/>
updateField('rightQuote', val)}
- description={t('string:quote.rightQuoteDescription')}
+ description={t('quote.rightQuoteDescription')}
/>
updateField('doubleQuotation', checked)}
- title={t('string:quote.allowDoubleQuotation')}
+ title={t('quote.allowDoubleQuotation')}
/>
updateField('emptyQuoting', checked)}
- title={t('string:quote.quoteEmptyLines')}
+ title={t('quote.quoteEmptyLines')}
/>
updateField('multiLine', checked)}
- title={t('string:quote.processAsMultiLine')}
+ title={t('quote.processAsMultiLine')}
/>
)
@@ -133,19 +133,19 @@ export default function Quote({ title }: ToolComponentProps) {
title={title}
inputComponent={
}
resultComponent={
-
+
}
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}
diff --git a/src/pages/tools/string/repeat/index.tsx b/src/pages/tools/string/repeat/index.tsx
index 694e0fe..2df00ba 100644
--- a/src/pages/tools/string/repeat/index.tsx
+++ b/src/pages/tools/string/repeat/index.tsx
@@ -49,7 +49,7 @@ const exampleCards: CardExampleType[] = [
];
export default function Replacer({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('string');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -62,12 +62,12 @@ export default function Replacer({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('string:repeat.textRepetitions'),
+ title: t('repeat.textRepetitions'),
component: (
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: (
updateField('delimiter', val)}
type={'text'}
@@ -101,17 +101,17 @@ export default function Replacer({ title }: ToolComponentProps) {
setInput={setInput}
inputComponent={
}
resultComponent={
-
+
}
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}
/>
diff --git a/src/pages/tools/string/reverse/index.tsx b/src/pages/tools/string/reverse/index.tsx
index 328688f..8406c65 100644
--- a/src/pages/tools/string/reverse/index.tsx
+++ b/src/pages/tools/string/reverse/index.tsx
@@ -59,7 +59,7 @@ const exampleCards: CardExampleType[] = [
];
export default function Reverse({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('string');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -76,27 +76,27 @@ export default function Reverse({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('string:reverse.reversalOptions'),
+ title: t('reverse.reversalOptions'),
component: [
updateField('multiLine', val)}
/>,
updateField('emptyItems', val)}
/>,
updateField('trim', val)}
/>
]
@@ -113,16 +113,13 @@ export default function Reverse({ title }: ToolComponentProps) {
setInput={setInput}
inputComponent={
}
resultComponent={
-
+
}
exampleCards={exampleCards}
/>
diff --git a/src/pages/tools/string/rot13/index.tsx b/src/pages/tools/string/rot13/index.tsx
index a0a3d49..ca0e848 100644
--- a/src/pages/tools/string/rot13/index.tsx
+++ b/src/pages/tools/string/rot13/index.tsx
@@ -31,7 +31,7 @@ const exampleCards: CardExampleType[] = [
];
export default function Rot13({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('string');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -44,19 +44,19 @@ export default function Rot13({ title }: ToolComponentProps) {
title={title}
inputComponent={
}
resultComponent={
-
+
}
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}
diff --git a/src/pages/tools/string/rotate/index.tsx b/src/pages/tools/string/rotate/index.tsx
index 42f9590..cb4fea5 100644
--- a/src/pages/tools/string/rotate/index.tsx
+++ b/src/pages/tools/string/rotate/index.tsx
@@ -64,7 +64,7 @@ const exampleCards: CardExampleType[] = [
];
export default function Rotate({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('string');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -81,29 +81,29 @@ export default function Rotate({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('string:rotate.rotationOptions'),
+ title: t('rotate.rotationOptions'),
component: (
updateField('step', val)}
- description={t('string:rotate.stepDescription')}
+ description={t('rotate.stepDescription')}
type="number"
/>
updateField('direction', 'right')}
checked={values.direction === 'right'}
- title={t('string:rotate.rotateRight')}
+ title={t('rotate.rotateRight')}
/>
updateField('direction', 'left')}
checked={values.direction === 'left'}
- title={t('string:rotate.rotateLeft')}
+ title={t('rotate.rotateLeft')}
/>
updateField('multiLine', checked)}
- title={t('string:rotate.processAsMultiLine')}
+ title={t('rotate.processAsMultiLine')}
/>
)
@@ -115,19 +115,19 @@ export default function Rotate({ title }: ToolComponentProps) {
title={title}
inputComponent={
}
resultComponent={
-
+
}
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}
diff --git a/src/pages/tools/string/split/index.tsx b/src/pages/tools/string/split/index.tsx
index 705d507..89c49a1 100644
--- a/src/pages/tools/string/split/index.tsx
+++ b/src/pages/tools/string/split/index.tsx
@@ -133,7 +133,7 @@ easy`,
];
export default function SplitText({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('string');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -173,12 +173,12 @@ export default function SplitText({ title }: ToolComponentProps) {
input={input}
inputComponent={}
resultComponent={
-
+
}
initialValues={initialValues}
getGroups={({ values, updateField }) => [
{
- title: t('string:split.splitSeparatorOptions'),
+ title: t('split.splitSeparatorOptions'),
component: splitOperators.map(({ title, description, type }) => (
(
('');
const [result, setResult] = useState('');
@@ -230,38 +230,38 @@ export default function Truncate({
updateField
}) => [
{
- title: t('string:statistic.delimitersOptions'),
+ title: t('statistic.delimitersOptions'),
component: (
updateField('sentenceDelimiters', val)}
- placeholder={t('string:statistic.sentenceDelimitersPlaceholder')}
- description={t('string:statistic.sentenceDelimitersDescription')}
+ placeholder={t('statistic.sentenceDelimitersPlaceholder')}
+ description={t('statistic.sentenceDelimitersDescription')}
/>
updateField('wordDelimiters', val)}
- placeholder={t('string:statistic.wordDelimitersPlaceholder')}
- description={t('string:statistic.wordDelimitersDescription')}
+ placeholder={t('statistic.wordDelimitersPlaceholder')}
+ description={t('statistic.wordDelimitersDescription')}
/>
)
},
{
- title: t('string:statistic.statisticsOptions'),
+ title: t('statistic.statisticsOptions'),
component: (
updateField('wordCount', value)}
- title={t('string:statistic.wordFrequencyAnalysis')}
- description={t('string:statistic.wordFrequencyAnalysisDescription')}
+ title={t('statistic.wordFrequencyAnalysis')}
+ description={t('statistic.wordFrequencyAnalysisDescription')}
/>
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({
updateField('emptyLines', value)}
- title={t('string:statistic.includeEmptyLines')}
- description={t('string:statistic.includeEmptyLinesDescription')}
+ title={t('statistic.includeEmptyLines')}
+ description={t('statistic.includeEmptyLinesDescription')}
/>
)
@@ -287,19 +287,16 @@ export default function Truncate({
setInput={setInput}
inputComponent={
}
resultComponent={
-
+
}
toolInfo={{
- title: t('string:statistic.toolInfo.title', { title }),
+ title: t('statistic.toolInfo.title', { title }),
description: longDescription
}}
exampleCards={exampleCards}
diff --git a/src/pages/tools/string/text-replacer/index.tsx b/src/pages/tools/string/text-replacer/index.tsx
index 378325b..3908f62 100644
--- a/src/pages/tools/string/text-replacer/index.tsx
+++ b/src/pages/tools/string/text-replacer/index.tsx
@@ -61,7 +61,7 @@ const exampleCards: CardExampleType[] = [
];
export default function Replacer({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('string');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -74,16 +74,16 @@ export default function Replacer({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('string:textReplacer.searchText'),
+ title: t('textReplacer.searchText'),
component: (
updateField('mode', 'text')}
checked={values.mode === 'text'}
- title={t('string:textReplacer.findPatternInText')}
+ title={t('textReplacer.findPatternInText')}
/>
updateField('searchValue', val)}
type={'text'}
@@ -91,10 +91,10 @@ export default function Replacer({ title }: ToolComponentProps) {
updateField('mode', 'regexp')}
checked={values.mode === 'regexp'}
- title={t('string:textReplacer.findPatternUsingRegexp')}
+ title={t('textReplacer.findPatternUsingRegexp')}
/>
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: (
updateField('replaceValue', val)}
type={'text'}
@@ -128,20 +128,17 @@ export default function Replacer({ title }: ToolComponentProps) {
setInput={setInput}
inputComponent={
}
resultComponent={
-
+
}
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}
/>
diff --git a/src/pages/tools/string/to-morse/index.tsx b/src/pages/tools/string/to-morse/index.tsx
index f94659d..f50e547 100644
--- a/src/pages/tools/string/to-morse/index.tsx
+++ b/src/pages/tools/string/to-morse/index.tsx
@@ -12,7 +12,7 @@ const initialValues = {
};
export default function ToMorse() {
- const { t } = useTranslation();
+ const { t } = useTranslation('string');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
const computeOptions = (optionsValues: typeof initialValues, input: any) => {
@@ -22,34 +22,31 @@ export default function ToMorse() {
return (
}
resultComponent={
-
+
}
getGroups={({ values, updateField }) => [
{
- title: t('string:toMorse.shortSignal'),
+ title: t('toMorse.shortSignal'),
component: (
updateField('dotSymbol', val)}
/>
)
},
{
- title: t('string:toMorse.longSignal'),
+ title: t('toMorse.longSignal'),
component: (
updateField('dashSymbol', val)}
/>
diff --git a/src/pages/tools/string/truncate/index.tsx b/src/pages/tools/string/truncate/index.tsx
index 3bc8a26..399054e 100644
--- a/src/pages/tools/string/truncate/index.tsx
+++ b/src/pages/tools/string/truncate/index.tsx
@@ -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('');
const [result, setResult] = useState('');
@@ -81,31 +81,31 @@ export default function Truncate({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('string:truncate.truncationSide'),
+ title: t('truncate.truncationSide'),
component: (
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')}
/>
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')}
/>
)
},
{
- title: t('string:truncate.lengthAndLines'),
+ title: t('truncate.lengthAndLines'),
component: (
updateField('maxLength', val)}
type={'number'}
@@ -113,25 +113,25 @@ export default function Truncate({ title }: ToolComponentProps) {
updateField('lineByLine', val)}
checked={values.lineByLine}
- title={t('string:truncate.lineByLineTruncating')}
- description={t('string:truncate.lineByLineDescription')}
+ title={t('truncate.lineByLineTruncating')}
+ description={t('truncate.lineByLineDescription')}
/>
)
},
{
- title: t('string:truncate.suffixAndAffix'),
+ title: t('truncate.suffixAndAffix'),
component: (
updateField('addIndicator', val)}
checked={values.addIndicator}
- title={t('string:truncate.addTruncationIndicator')}
+ title={t('truncate.addTruncationIndicator')}
description={''}
/>
updateField('indicator', val)}
type={'text'}
@@ -151,20 +151,17 @@ export default function Truncate({ title }: ToolComponentProps) {
setInput={setInput}
inputComponent={
}
resultComponent={
-
+
}
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}
/>
diff --git a/src/pages/tools/string/uppercase/index.tsx b/src/pages/tools/string/uppercase/index.tsx
index bb6a9b7..a09713f 100644
--- a/src/pages/tools/string/uppercase/index.tsx
+++ b/src/pages/tools/string/uppercase/index.tsx
@@ -36,7 +36,7 @@ const exampleCards: CardExampleType[] = [
];
export default function Uppercase({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('string');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -57,16 +57,13 @@ export default function Uppercase({ title }: ToolComponentProps) {
setInput={setInput}
inputComponent={
}
resultComponent={
-
+
}
exampleCards={exampleCards}
/>
diff --git a/src/pages/tools/time/check-leap-years/index.tsx b/src/pages/tools/time/check-leap-years/index.tsx
index 8d941ee..b960f14 100644
--- a/src/pages/tools/time/check-leap-years/index.tsx
+++ b/src/pages/tools/time/check-leap-years/index.tsx
@@ -57,7 +57,7 @@ export default function ConvertDaysToHours({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('time');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -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}
diff --git a/src/pages/tools/time/convert-days-to-hours/index.tsx b/src/pages/tools/time/convert-days-to-hours/index.tsx
index 89a2da3..b8f83c1 100644
--- a/src/pages/tools/time/convert-days-to-hours/index.tsx
+++ b/src/pages/tools/time/convert-days-to-hours/index.tsx
@@ -63,7 +63,7 @@ export default function ConvertDaysToHours({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('time');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -76,14 +76,14 @@ export default function ConvertDaysToHours({
updateField
}) => [
{
- title: t('time:convertDaysToHours.hoursName'),
+ title: t('convertDaysToHours.hoursName'),
component: (
updateField('hoursFlag', val)}
checked={values.hoursFlag}
- title={t('time:convertDaysToHours.addHoursName')}
- description={t('time:convertDaysToHours.addHoursNameDescription')}
+ title={t('convertDaysToHours.addHoursName')}
+ description={t('convertDaysToHours.addHoursNameDescription')}
/>
)
@@ -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}
/>
diff --git a/src/pages/tools/time/convert-seconds-to-time/index.tsx b/src/pages/tools/time/convert-seconds-to-time/index.tsx
index f877ee9..0e5d10d 100644
--- a/src/pages/tools/time/convert-seconds-to-time/index.tsx
+++ b/src/pages/tools/time/convert-seconds-to-time/index.tsx
@@ -69,7 +69,7 @@ export default function SecondsToTime({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('time');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -82,14 +82,14 @@ export default function SecondsToTime({
updateField
}) => [
{
- title: t('time:convertSecondsToTime.timePadding'),
+ title: t('convertSecondsToTime.timePadding'),
component: (
updateField('paddingFlag', val)}
checked={values.paddingFlag}
- title={t('time:convertSecondsToTime.addPadding')}
- description={t('time:convertSecondsToTime.addPaddingDescription')}
+ title={t('convertSecondsToTime.addPadding')}
+ description={t('convertSecondsToTime.addPaddingDescription')}
/>
)
@@ -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}
diff --git a/src/pages/tools/time/convert-time-to-seconds/index.tsx b/src/pages/tools/time/convert-time-to-seconds/index.tsx
index 0f4a8a1..be48eb5 100644
--- a/src/pages/tools/time/convert-time-to-seconds/index.tsx
+++ b/src/pages/tools/time/convert-time-to-seconds/index.tsx
@@ -76,7 +76,7 @@ export default function TimeToSeconds({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('time');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -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}
diff --git a/src/pages/tools/time/time-between-dates/index.tsx b/src/pages/tools/time/time-between-dates/index.tsx
index 5e6808f..7caef08 100644
--- a/src/pages/tools/time/time-between-dates/index.tsx
+++ b/src/pages/tools/time/time-between-dates/index.tsx
@@ -121,12 +121,12 @@ const exampleCards: CardExampleType[] = [
];
export default function TimeBetweenDates() {
- const { t } = useTranslation();
+ const { t } = useTranslation('time');
const [result, setResult] = useState('');
return (
[
{
- title: t('time:timeBetweenDates.startDateTime'),
+ title: t('timeBetweenDates.startDateTime'),
component: (
updateField('startDate', val)}
type="date"
/>
updateField('startTime', val)}
type="time"
/>
updateField('startTimezone', val)}
options={timezoneOptions}
@@ -185,23 +185,23 @@ export default function TimeBetweenDates() {
)
},
{
- title: t('time:timeBetweenDates.endDateTime'),
+ title: t('timeBetweenDates.endDateTime'),
component: (
updateField('endDate', val)}
type="date"
/>
updateField('endTime', val)}
type="time"
/>
updateField('endTimezone', val)}
options={timezoneOptions}
diff --git a/src/pages/tools/time/truncate-clock-time/index.tsx b/src/pages/tools/time/truncate-clock-time/index.tsx
index 9cd58fc..4ef19f3 100644
--- a/src/pages/tools/time/truncate-clock-time/index.tsx
+++ b/src/pages/tools/time/truncate-clock-time/index.tsx
@@ -68,7 +68,7 @@ export default function TruncateClockTime({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('time');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -88,13 +88,13 @@ export default function TruncateClockTime({
updateField
}) => [
{
- title: t('time:truncateClockTime.truncationSide'),
+ title: t('truncateClockTime.truncationSide'),
component: (
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({
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: (
updateField('zeroPrint', val)}
checked={values.zeroPrint}
- title={t('time:truncateClockTime.zeroPrintTruncatedParts')}
- description={t('time:truncateClockTime.zeroPrintDescription')}
+ title={t('truncateClockTime.zeroPrintTruncatedParts')}
+ description={t('truncateClockTime.zeroPrintDescription')}
/>
)
},
{
- title: t('time:truncateClockTime.timePadding'),
+ title: t('truncateClockTime.timePadding'),
component: (
updateField('zeroPadding', val)}
checked={values.zeroPadding}
- title={t('time:truncateClockTime.useZeroPadding')}
- description={t('time:truncateClockTime.zeroPaddingDescription')}
+ title={t('truncateClockTime.useZeroPadding')}
+ description={t('truncateClockTime.zeroPaddingDescription')}
/>
)
@@ -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}
diff --git a/src/pages/tools/video/change-speed/index.tsx b/src/pages/tools/video/change-speed/index.tsx
index aac2355..656c140 100644
--- a/src/pages/tools/video/change-speed/index.tsx
+++ b/src/pages/tools/video/change-speed/index.tsx
@@ -19,7 +19,7 @@ export default function ChangeSpeed({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('video');
const [input, setInput] = useState(null);
const [result, setResult] = useState(null);
const [loading, setLoading] = useState(false);
@@ -130,13 +130,13 @@ export default function ChangeSpeed({
updateField
}) => [
{
- title: t('video:changeSpeed.newVideoSpeed'),
+ title: t('changeSpeed.newVideoSpeed'),
component: (
updateField('newSpeed', Number(val))}
- description={t('video:changeSpeed.defaultMultiplier')}
+ description={t('changeSpeed.defaultMultiplier')}
type="number"
/>
@@ -151,19 +151,19 @@ export default function ChangeSpeed({
}
resultComponent={
loading ? (
) : (
@@ -174,7 +174,7 @@ export default function ChangeSpeed({
setInput={setInput}
compute={compute}
toolInfo={{
- title: t('video:changeSpeed.toolInfo.title', { title }),
+ title: t('changeSpeed.toolInfo.title', { title }),
description: longDescription
}}
/>
diff --git a/src/pages/tools/video/compress/index.tsx b/src/pages/tools/video/compress/index.tsx
index a383c99..069466f 100644
--- a/src/pages/tools/video/compress/index.tsx
+++ b/src/pages/tools/video/compress/index.tsx
@@ -69,7 +69,7 @@ const presetOptions = [
];
export default function CompressVideo({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('video');
const [input, setInput] = useState(null);
const [result, setResult] = useState(null);
const [loading, setLoading] = useState(false);
@@ -102,7 +102,7 @@ export default function CompressVideo({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('video:compress.resolution'),
+ title: t('compress.resolution'),
component: (
{resolutionOptions.map((option) => (
@@ -119,7 +119,7 @@ export default function CompressVideo({ title }: ToolComponentProps) {
)
},
{
- title: t('video:compress.quality'),
+ title: t('compress.quality'),
component: (
@@ -162,16 +162,16 @@ export default function CompressVideo({ title }: ToolComponentProps) {
}
resultComponent={
}
initialValues={initialValues}
diff --git a/src/pages/tools/video/crop-video/index.tsx b/src/pages/tools/video/crop-video/index.tsx
index 30aea5f..939bb95 100644
--- a/src/pages/tools/video/crop-video/index.tsx
+++ b/src/pages/tools/video/crop-video/index.tsx
@@ -18,7 +18,7 @@ const initialValues: InitialValuesType = {
};
export default function CropVideo({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('video');
const [input, setInput] = useState(null);
const [result, setResult] = useState(null);
const [loading, setLoading] = useState(false);
@@ -32,21 +32,21 @@ export default function CropVideo({ title }: ToolComponentProps) {
if (!videoDimensions) return '';
if (values.x < 0 || values.y < 0) {
- return t('video:cropVideo.errorNonNegativeCoordinates');
+ return t('cropVideo.errorNonNegativeCoordinates');
}
if (values.width <= 0 || values.height <= 0) {
- return t('video:cropVideo.errorPositiveDimensions');
+ return t('cropVideo.errorPositiveDimensions');
}
if (values.x + values.width > videoDimensions.width) {
- return t('video:cropVideo.errorBeyondWidth', {
+ return t('cropVideo.errorBeyondWidth', {
width: videoDimensions.width
});
}
if (values.y + values.height > videoDimensions.height) {
- return t('video:cropVideo.errorBeyondHeight', {
+ return t('cropVideo.errorBeyondHeight', {
height: videoDimensions.height
});
}
@@ -74,7 +74,7 @@ export default function CropVideo({ title }: ToolComponentProps) {
setResult(croppedFile);
} catch (error) {
console.error('Error cropping video:', error);
- setProcessingError(t('video:cropVideo.errorCroppingVideo'));
+ setProcessingError(t('cropVideo.errorCroppingVideo'));
} finally {
setLoading(false);
}
@@ -90,26 +90,26 @@ export default function CropVideo({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('video:cropVideo.videoInformation'),
+ title: t('cropVideo.videoInformation'),
component: (
{videoDimensions ? (
- {t('video:cropVideo.videoDimensions', {
+ {t('cropVideo.videoDimensions', {
width: videoDimensions.width,
height: videoDimensions.height
})}
) : (
- {t('video:cropVideo.loadVideoForDimensions')}
+ {t('cropVideo.loadVideoForDimensions')}
)}
)
},
{
- title: t('video:cropVideo.cropCoordinates'),
+ title: t('cropVideo.cropCoordinates'),
component: (
{processingError && (
@@ -119,7 +119,7 @@ export default function CropVideo({ title }: ToolComponentProps) {
)}
updateField('x', parseInt(e.target.value) || 0)}
@@ -127,7 +127,7 @@ export default function CropVideo({ title }: ToolComponentProps) {
inputProps={{ min: 0 }}
/>
updateField('y', parseInt(e.target.value) || 0)}
@@ -137,7 +137,7 @@ export default function CropVideo({ title }: ToolComponentProps) {
@@ -147,7 +147,7 @@ export default function CropVideo({ title }: ToolComponentProps) {
inputProps={{ min: 1 }}
/>
@@ -189,9 +189,7 @@ export default function CropVideo({ title }: ToolComponentProps) {
})
.catch((error) => {
console.error('Error getting video dimensions:', error);
- setProcessingError(
- t('video:cropVideo.errorLoadingDimensions')
- );
+ setProcessingError(t('cropVideo.errorLoadingDimensions'));
});
} else {
setVideoDimensions(null);
@@ -199,20 +197,20 @@ export default function CropVideo({ title }: ToolComponentProps) {
}
setInput(video);
}}
- title={t('video:cropVideo.inputTitle')}
+ title={t('cropVideo.inputTitle')}
/>
)}
resultComponent={
loading ? (
) : (
diff --git a/src/pages/tools/video/flip/index.tsx b/src/pages/tools/video/flip/index.tsx
index a40c5fe..31b3e7e 100644
--- a/src/pages/tools/video/flip/index.tsx
+++ b/src/pages/tools/video/flip/index.tsx
@@ -31,7 +31,7 @@ const orientationOptions: { value: FlipOrientation; label: string }[] = [
];
export default function FlipVideo({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('video');
const [input, setInput] = useState(null);
const [result, setResult] = useState(null);
const [loading, setLoading] = useState(false);
@@ -60,7 +60,7 @@ export default function FlipVideo({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('video:flip.orientation'),
+ title: t('flip.orientation'),
component: (
{orientationOptions.map((orientationOption) => (
@@ -86,20 +86,20 @@ export default function FlipVideo({ title }: ToolComponentProps) {
}
resultComponent={
loading ? (
) : (
diff --git a/src/pages/tools/video/i18n/en.json b/src/pages/tools/video/i18n/en.json
index c066333..940a4bc 100644
--- a/src/pages/tools/video/i18n/en.json
+++ b/src/pages/tools/video/i18n/en.json
@@ -75,5 +75,12 @@
"title": "Crop Video",
"description": "This tool allows you to crop video files to remove unwanted areas. You can specify the crop area by setting the X, Y coordinates and width, height dimensions."
}
+ },
+ "trim": {
+ "timestamps": "Timestamps",
+ "startTime": "Start Time",
+ "endTime": "End Time",
+ "inputTitle": "Input Video",
+ "resultTitle": "Trimmed Video"
}
}
diff --git a/src/pages/tools/video/loop/index.tsx b/src/pages/tools/video/loop/index.tsx
index ecd7e4b..8c23d9f 100644
--- a/src/pages/tools/video/loop/index.tsx
+++ b/src/pages/tools/video/loop/index.tsx
@@ -22,7 +22,7 @@ const validationSchema = Yup.object({
});
export default function Loop({ title, longDescription }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('video');
const [input, setInput] = useState(null);
const [result, setResult] = useState(null);
const [loading, setLoading] = useState(false);
@@ -45,7 +45,7 @@ export default function Loop({ title, longDescription }: ToolComponentProps) {
updateField
}) => [
{
- title: t('video:loop.loops'),
+ title: t('loop.loops'),
component: (
)
@@ -68,14 +68,14 @@ export default function Loop({ title, longDescription }: ToolComponentProps) {
loading ? (
) : (
)
@@ -86,7 +86,7 @@ export default function Loop({ title, longDescription }: ToolComponentProps) {
setInput={setInput}
compute={compute}
toolInfo={{
- title: t('video:loop.toolInfo.title', { title }),
+ title: t('loop.toolInfo.title', { title }),
description: longDescription
}}
/>
diff --git a/src/pages/tools/video/rotate/index.tsx b/src/pages/tools/video/rotate/index.tsx
index ea072e3..5f8b404 100644
--- a/src/pages/tools/video/rotate/index.tsx
+++ b/src/pages/tools/video/rotate/index.tsx
@@ -28,7 +28,7 @@ const angleOptions: { value: RotationAngle; label: string }[] = [
{ value: 270, label: '270° (90° Counter-clockwise)' }
];
export default function RotateVideo({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('video');
const [input, setInput] = useState(null);
const [result, setResult] = useState(null);
const [loading, setLoading] = useState(false);
@@ -57,7 +57,7 @@ export default function RotateVideo({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('video:rotate.rotation'),
+ title: t('rotate.rotation'),
component: (
{angleOptions.map((angleOption) => (
@@ -83,20 +83,20 @@ export default function RotateVideo({ title }: ToolComponentProps) {
}
resultComponent={
loading ? (
) : (
diff --git a/src/pages/tools/video/trim/index.tsx b/src/pages/tools/video/trim/index.tsx
index cc260cf..52bdc27 100644
--- a/src/pages/tools/video/trim/index.tsx
+++ b/src/pages/tools/video/trim/index.tsx
@@ -29,7 +29,7 @@ const validationSchema = Yup.object({
});
export default function TrimVideo({ title }: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('video');
const [input, setInput] = useState(null);
const [result, setResult] = useState(null);
@@ -87,7 +87,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
updateField
}) => [
{
- title: t('video:trim.timestamps'),
+ title: t('trim.timestamps'),
component: (
)
@@ -118,7 +118,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
{
setFieldValue('trimStart', trimStart);
@@ -131,7 +131,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
}}
resultComponent={
diff --git a/src/pages/tools/xml/xml-beautifier/index.tsx b/src/pages/tools/xml/xml-beautifier/index.tsx
index 8ad6099..c1adb57 100644
--- a/src/pages/tools/xml/xml-beautifier/index.tsx
+++ b/src/pages/tools/xml/xml-beautifier/index.tsx
@@ -1,4 +1,3 @@
-import { Box } from '@mui/material';
import React, { useState } from 'react';
import ToolContent from '@components/ToolContent';
import { ToolComponentProps } from '@tools/defineTool';
@@ -25,7 +24,7 @@ export default function XmlBeautifier({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('xml');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -39,15 +38,14 @@ export default function XmlBeautifier({
input={input}
inputComponent={
}
resultComponent={
@@ -58,7 +56,7 @@ export default function XmlBeautifier({
setInput={setInput}
compute={compute}
toolInfo={{
- title: t('xml:beautifier.toolInfo.title', { title }),
+ title: t('xmlBeautifier.toolInfo.title', { title }),
description: longDescription
}}
/>
diff --git a/src/pages/tools/xml/xml-validator/index.tsx b/src/pages/tools/xml/xml-validator/index.tsx
index f691a24..6349272 100644
--- a/src/pages/tools/xml/xml-validator/index.tsx
+++ b/src/pages/tools/xml/xml-validator/index.tsx
@@ -32,7 +32,7 @@ export default function XmlValidator({
title,
longDescription
}: ToolComponentProps) {
- const { t } = useTranslation();
+ const { t } = useTranslation('xml');
const [input, setInput] = useState('');
const [result, setResult] = useState('');
@@ -48,7 +48,7 @@ export default function XmlValidator({
}
resultComponent={}
@@ -58,8 +58,8 @@ export default function XmlValidator({
setInput={setInput}
compute={compute}
toolInfo={{
- title: t('xml:xmlValidator.toolInfo.title'),
- description: t('xml:xmlValidator.toolInfo.description')
+ title: t('xmlValidator.toolInfo.title'),
+ description: t('xmlValidator.toolInfo.description')
}}
/>
);