mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-12-29 16:16:02 +00:00
fix: misc
This commit is contained in:
@@ -130,13 +130,13 @@ export default function ChangeSpeed({
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('video.changeSpeed.newVideoSpeed'),
|
||||
title: t('video:changeSpeed.newVideoSpeed'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
value={values.newSpeed.toString()}
|
||||
onOwnChange={(val) => updateField('newSpeed', Number(val))}
|
||||
description={t('video.changeSpeed.defaultMultiplier')}
|
||||
description={t('video:changeSpeed.defaultMultiplier')}
|
||||
type="number"
|
||||
/>
|
||||
</Box>
|
||||
@@ -151,19 +151,19 @@ export default function ChangeSpeed({
|
||||
<ToolVideoInput
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
title={t('video.changeSpeed.inputTitle')}
|
||||
title={t('video:changeSpeed.inputTitle')}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
loading ? (
|
||||
<ToolFileResult
|
||||
title={t('video.changeSpeed.settingSpeed')}
|
||||
title={t('video:changeSpeed.settingSpeed')}
|
||||
value={null}
|
||||
loading={true}
|
||||
/>
|
||||
) : (
|
||||
<ToolFileResult
|
||||
title={t('video.changeSpeed.resultTitle')}
|
||||
title={t('video:changeSpeed.resultTitle')}
|
||||
value={result}
|
||||
extension="mp4"
|
||||
/>
|
||||
@@ -174,7 +174,7 @@ export default function ChangeSpeed({
|
||||
setInput={setInput}
|
||||
compute={compute}
|
||||
toolInfo={{
|
||||
title: t('video.changeSpeed.toolInfo.title', { title }),
|
||||
title: t('video:changeSpeed.toolInfo.title', { title }),
|
||||
description: longDescription
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -11,8 +11,8 @@ export const tool = defineTool('video', {
|
||||
keywords: ['video', 'speed', 'playback', 'fast', 'slow'],
|
||||
component: lazy(() => import('./index')),
|
||||
i18n: {
|
||||
name: 'video.changeSpeed.name',
|
||||
description: 'video.changeSpeed.description',
|
||||
shortDescription: 'video.changeSpeed.shortDescription'
|
||||
name: 'video:changeSpeed.title',
|
||||
description: 'video:changeSpeed.description',
|
||||
shortDescription: 'video:changeSpeed.shortDescription'
|
||||
}
|
||||
});
|
||||
|
||||
@@ -102,7 +102,7 @@ export default function CompressVideo({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('video.compress.resolution'),
|
||||
title: t('video:compress.resolution'),
|
||||
component: (
|
||||
<Box>
|
||||
{resolutionOptions.map((option) => (
|
||||
@@ -119,7 +119,7 @@ export default function CompressVideo({ title }: ToolComponentProps) {
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('video.compress.quality'),
|
||||
title: t('video:compress.quality'),
|
||||
component: (
|
||||
<Box sx={{ mb: 2 }}>
|
||||
<Slider
|
||||
@@ -131,9 +131,9 @@ export default function CompressVideo({ title }: ToolComponentProps) {
|
||||
updateField('crf', typeof value === 'number' ? value : value[0]);
|
||||
}}
|
||||
marks={{
|
||||
0: t('video.compress.lossless'),
|
||||
23: t('video.compress.default'),
|
||||
51: t('video.compress.worst')
|
||||
0: t('video:compress.lossless'),
|
||||
23: t('video:compress.default'),
|
||||
51: t('video:compress.worst')
|
||||
}}
|
||||
/>
|
||||
</Box>
|
||||
@@ -162,16 +162,16 @@ export default function CompressVideo({ title }: ToolComponentProps) {
|
||||
<ToolVideoInput
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
title={t('video.compress.inputTitle')}
|
||||
title={t('video:compress.inputTitle')}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolFileResult
|
||||
title={t('video.compress.resultTitle')}
|
||||
title={t('video:compress.resultTitle')}
|
||||
value={result}
|
||||
extension={'mp4'}
|
||||
loading={loading}
|
||||
loadingText={t('video.compress.loadingText')}
|
||||
loadingText={t('video:compress.loadingText')}
|
||||
/>
|
||||
}
|
||||
initialValues={initialValues}
|
||||
|
||||
@@ -18,8 +18,8 @@ export const tool = defineTool('video', {
|
||||
],
|
||||
component: lazy(() => import('./index')),
|
||||
i18n: {
|
||||
name: 'video.compress.name',
|
||||
description: 'video.compress.description',
|
||||
shortDescription: 'video.compress.shortDescription'
|
||||
name: 'video:compress.title',
|
||||
description: 'video:compress.description',
|
||||
shortDescription: 'video:compress.shortDescription'
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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('video:cropVideo.errorNonNegativeCoordinates');
|
||||
}
|
||||
|
||||
if (values.width <= 0 || values.height <= 0) {
|
||||
return t('video.cropVideo.errorPositiveDimensions');
|
||||
return t('video:cropVideo.errorPositiveDimensions');
|
||||
}
|
||||
|
||||
if (values.x + values.width > videoDimensions.width) {
|
||||
return t('video.cropVideo.errorBeyondWidth', {
|
||||
return t('video:cropVideo.errorBeyondWidth', {
|
||||
width: videoDimensions.width
|
||||
});
|
||||
}
|
||||
|
||||
if (values.y + values.height > videoDimensions.height) {
|
||||
return t('video.cropVideo.errorBeyondHeight', {
|
||||
return t('video: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('video:cropVideo.errorCroppingVideo'));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
@@ -90,26 +90,26 @@ export default function CropVideo({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('video.cropVideo.videoInformation'),
|
||||
title: t('video:cropVideo.videoInformation'),
|
||||
component: (
|
||||
<Box>
|
||||
{videoDimensions ? (
|
||||
<Typography variant="body2" sx={{ mb: 2 }}>
|
||||
{t('video.cropVideo.videoDimensions', {
|
||||
{t('video:cropVideo.videoDimensions', {
|
||||
width: videoDimensions.width,
|
||||
height: videoDimensions.height
|
||||
})}
|
||||
</Typography>
|
||||
) : (
|
||||
<Typography variant="body2" sx={{ mb: 2 }}>
|
||||
{t('video.cropVideo.loadVideoForDimensions')}
|
||||
{t('video:cropVideo.loadVideoForDimensions')}
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
)
|
||||
},
|
||||
{
|
||||
title: t('video.cropVideo.cropCoordinates'),
|
||||
title: t('video:cropVideo.cropCoordinates'),
|
||||
component: (
|
||||
<Box sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>
|
||||
{processingError && (
|
||||
@@ -119,7 +119,7 @@ export default function CropVideo({ title }: ToolComponentProps) {
|
||||
)}
|
||||
<Box sx={{ display: 'flex', gap: 2 }}>
|
||||
<TextField
|
||||
label={t('video.cropVideo.xCoordinate')}
|
||||
label={t('video:cropVideo.xCoordinate')}
|
||||
type="number"
|
||||
value={values.x}
|
||||
onChange={(e) => updateField('x', parseInt(e.target.value) || 0)}
|
||||
@@ -127,7 +127,7 @@ export default function CropVideo({ title }: ToolComponentProps) {
|
||||
inputProps={{ min: 0 }}
|
||||
/>
|
||||
<TextField
|
||||
label={t('video.cropVideo.yCoordinate')}
|
||||
label={t('video:cropVideo.yCoordinate')}
|
||||
type="number"
|
||||
value={values.y}
|
||||
onChange={(e) => updateField('y', parseInt(e.target.value) || 0)}
|
||||
@@ -137,7 +137,7 @@ export default function CropVideo({ title }: ToolComponentProps) {
|
||||
</Box>
|
||||
<Box sx={{ display: 'flex', gap: 2 }}>
|
||||
<TextField
|
||||
label={t('video.cropVideo.width')}
|
||||
label={t('video:cropVideo.width')}
|
||||
type="number"
|
||||
value={values.width}
|
||||
onChange={(e) =>
|
||||
@@ -147,7 +147,7 @@ export default function CropVideo({ title }: ToolComponentProps) {
|
||||
inputProps={{ min: 1 }}
|
||||
/>
|
||||
<TextField
|
||||
label={t('video.cropVideo.height')}
|
||||
label={t('video:cropVideo.height')}
|
||||
type="number"
|
||||
value={values.height}
|
||||
onChange={(e) =>
|
||||
@@ -190,7 +190,7 @@ export default function CropVideo({ title }: ToolComponentProps) {
|
||||
.catch((error) => {
|
||||
console.error('Error getting video dimensions:', error);
|
||||
setProcessingError(
|
||||
t('video.cropVideo.errorLoadingDimensions')
|
||||
t('video:cropVideo.errorLoadingDimensions')
|
||||
);
|
||||
});
|
||||
} else {
|
||||
@@ -199,20 +199,20 @@ export default function CropVideo({ title }: ToolComponentProps) {
|
||||
}
|
||||
setInput(video);
|
||||
}}
|
||||
title={t('video.cropVideo.inputTitle')}
|
||||
title={t('video:cropVideo.inputTitle')}
|
||||
/>
|
||||
)}
|
||||
resultComponent={
|
||||
loading ? (
|
||||
<ToolFileResult
|
||||
title={t('video.cropVideo.croppingVideo')}
|
||||
title={t('video:cropVideo.croppingVideo')}
|
||||
value={null}
|
||||
loading={true}
|
||||
extension={''}
|
||||
/>
|
||||
) : (
|
||||
<ToolFileResult
|
||||
title={t('video.cropVideo.resultTitle')}
|
||||
title={t('video:cropVideo.resultTitle')}
|
||||
value={result}
|
||||
extension={'mp4'}
|
||||
/>
|
||||
|
||||
@@ -11,8 +11,8 @@ export const tool = defineTool('video', {
|
||||
keywords: ['video', 'crop', 'trim', 'edit', 'resize'],
|
||||
component: lazy(() => import('./index')),
|
||||
i18n: {
|
||||
name: 'video.cropVideo.name',
|
||||
description: 'video.cropVideo.description',
|
||||
shortDescription: 'video.cropVideo.shortDescription'
|
||||
name: 'video:cropVideo.title',
|
||||
description: 'video:cropVideo.description',
|
||||
shortDescription: 'video:cropVideo.shortDescription'
|
||||
}
|
||||
});
|
||||
|
||||
@@ -60,7 +60,7 @@ export default function FlipVideo({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('video.flip.orientation'),
|
||||
title: t('video:flip.orientation'),
|
||||
component: (
|
||||
<Box>
|
||||
{orientationOptions.map((orientationOption) => (
|
||||
@@ -86,20 +86,20 @@ export default function FlipVideo({ title }: ToolComponentProps) {
|
||||
<ToolVideoInput
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
title={t('video.flip.inputTitle')}
|
||||
title={t('video:flip.inputTitle')}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
loading ? (
|
||||
<ToolFileResult
|
||||
title={t('video.flip.flippingVideo')}
|
||||
title={t('video:flip.flippingVideo')}
|
||||
value={null}
|
||||
loading={true}
|
||||
extension={''}
|
||||
/>
|
||||
) : (
|
||||
<ToolFileResult
|
||||
title={t('video.flip.resultTitle')}
|
||||
title={t('video:flip.resultTitle')}
|
||||
value={result}
|
||||
extension={'mp4'}
|
||||
/>
|
||||
|
||||
@@ -11,8 +11,8 @@ export const tool = defineTool('video', {
|
||||
keywords: ['video', 'flip', 'mirror', 'horizontal', 'vertical'],
|
||||
component: lazy(() => import('./index')),
|
||||
i18n: {
|
||||
name: 'video.flip.name',
|
||||
description: 'video.flip.description',
|
||||
shortDescription: 'video.flip.shortDescription'
|
||||
name: 'video:flip.title',
|
||||
description: 'video:flip.description',
|
||||
shortDescription: 'video:flip.shortDescription'
|
||||
}
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ export const tool = defineTool('gif', {
|
||||
keywords: ['gif', 'speed', 'animation', 'fast', 'slow'],
|
||||
component: lazy(() => import('./index')),
|
||||
i18n: {
|
||||
name: 'gif.changeSpeed.name',
|
||||
name: 'gif.changeSpeed.title',
|
||||
description: 'gif.changeSpeed.description',
|
||||
shortDescription: 'gif.changeSpeed.shortDescription'
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ export default function Loop({ title, longDescription }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('video.loop.loops'),
|
||||
title: t('video:loop.loops'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
@@ -53,7 +53,7 @@ export default function Loop({ title, longDescription }: ToolComponentProps) {
|
||||
updateNumberField(value, 'loops', updateField)
|
||||
}
|
||||
value={values.loops}
|
||||
label={t('video.loop.numberOfLoops')}
|
||||
label={t('video:loop.numberOfLoops')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
@@ -68,14 +68,14 @@ export default function Loop({ title, longDescription }: ToolComponentProps) {
|
||||
loading ? (
|
||||
<ToolFileResult
|
||||
value={null}
|
||||
title={t('video.loop.loopingVideo')}
|
||||
title={t('video:loop.loopingVideo')}
|
||||
loading={true}
|
||||
extension={''}
|
||||
/>
|
||||
) : (
|
||||
<ToolFileResult
|
||||
value={result}
|
||||
title={t('video.loop.resultTitle')}
|
||||
title={t('video:loop.resultTitle')}
|
||||
extension={'mp4'}
|
||||
/>
|
||||
)
|
||||
@@ -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('video:loop.toolInfo.title', { title }),
|
||||
description: longDescription
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -11,8 +11,8 @@ export const tool = defineTool('video', {
|
||||
keywords: ['video', 'loop', 'repeat', 'continuous'],
|
||||
component: lazy(() => import('./index')),
|
||||
i18n: {
|
||||
name: 'video.loop.name',
|
||||
description: 'video.loop.description',
|
||||
shortDescription: 'video.loop.shortDescription'
|
||||
name: 'video:loop.title',
|
||||
description: 'video:loop.description',
|
||||
shortDescription: 'video:loop.shortDescription'
|
||||
}
|
||||
});
|
||||
|
||||
@@ -57,7 +57,7 @@ export default function RotateVideo({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('video.rotate.rotation'),
|
||||
title: t('video:rotate.rotation'),
|
||||
component: (
|
||||
<Box>
|
||||
{angleOptions.map((angleOption) => (
|
||||
@@ -83,20 +83,20 @@ export default function RotateVideo({ title }: ToolComponentProps) {
|
||||
<ToolVideoInput
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
title={t('video.rotate.inputTitle')}
|
||||
title={t('video:rotate.inputTitle')}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
loading ? (
|
||||
<ToolFileResult
|
||||
title={t('video.rotate.rotatingVideo')}
|
||||
title={t('video:rotate.rotatingVideo')}
|
||||
value={null}
|
||||
loading={true}
|
||||
extension={''}
|
||||
/>
|
||||
) : (
|
||||
<ToolFileResult
|
||||
title={t('video.rotate.resultTitle')}
|
||||
title={t('video:rotate.resultTitle')}
|
||||
value={result}
|
||||
extension={'mp4'}
|
||||
/>
|
||||
|
||||
@@ -11,8 +11,8 @@ export const tool = defineTool('video', {
|
||||
keywords: ['video', 'rotate', 'orientation', 'degrees'],
|
||||
component: lazy(() => import('./index')),
|
||||
i18n: {
|
||||
name: 'video.rotate.name',
|
||||
description: 'video.rotate.description',
|
||||
shortDescription: 'video.rotate.shortDescription'
|
||||
name: 'video:rotate.title',
|
||||
description: 'video:rotate.description',
|
||||
shortDescription: 'video:rotate.shortDescription'
|
||||
}
|
||||
});
|
||||
|
||||
@@ -87,7 +87,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
|
||||
updateField
|
||||
}) => [
|
||||
{
|
||||
title: t('video.trim.timestamps'),
|
||||
title: t('video:trim.timestamps'),
|
||||
component: (
|
||||
<Box>
|
||||
<TextFieldWithDesc
|
||||
@@ -95,7 +95,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
|
||||
updateNumberField(value, 'trimStart', updateField)
|
||||
}
|
||||
value={values.trimStart}
|
||||
label={t('video.trim.startTime')}
|
||||
label={t('video:trim.startTime')}
|
||||
sx={{ mb: 2, backgroundColor: 'background.paper' }}
|
||||
/>
|
||||
<TextFieldWithDesc
|
||||
@@ -103,7 +103,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
|
||||
updateNumberField(value, 'trimEnd', updateField)
|
||||
}
|
||||
value={values.trimEnd}
|
||||
label={t('video.trim.endTime')}
|
||||
label={t('video:trim.endTime')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
@@ -118,7 +118,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
|
||||
<ToolVideoInput
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
title={t('video.trim.inputTitle')}
|
||||
title={t('video:trim.inputTitle')}
|
||||
showTrimControls={true}
|
||||
onTrimChange={(trimStart, trimEnd) => {
|
||||
setFieldValue('trimStart', trimStart);
|
||||
@@ -131,7 +131,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
|
||||
}}
|
||||
resultComponent={
|
||||
<ToolFileResult
|
||||
title={t('video.trim.resultTitle')}
|
||||
title={t('video:trim.resultTitle')}
|
||||
value={result}
|
||||
extension={'mp4'}
|
||||
/>
|
||||
|
||||
@@ -11,8 +11,8 @@ export const tool = defineTool('video', {
|
||||
keywords: ['video', 'trim', 'cut', 'edit', 'time'],
|
||||
component: lazy(() => import('./index')),
|
||||
i18n: {
|
||||
name: 'video.trim.name',
|
||||
description: 'video.trim.description',
|
||||
shortDescription: 'video.trim.shortDescription'
|
||||
name: 'video:trim.title',
|
||||
description: 'video:trim.description',
|
||||
shortDescription: 'video:trim.shortDescription'
|
||||
}
|
||||
});
|
||||
|
||||
@@ -11,8 +11,8 @@ export const tool = defineTool('video', {
|
||||
keywords: ['video', 'gif', 'convert', 'animated', 'image'],
|
||||
component: lazy(() => import('./index')),
|
||||
i18n: {
|
||||
name: 'video.videoToGif.name',
|
||||
description: 'video.videoToGif.description',
|
||||
shortDescription: 'video.videoToGif.shortDescription'
|
||||
name: 'video:videoToGif.title',
|
||||
description: 'video:videoToGif.description',
|
||||
shortDescription: 'video:videoToGif.shortDescription'
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user