fix: misc

This commit is contained in:
Ibrahima G. Coulibaly
2025-07-13 11:25:05 +01:00
parent 035eb2edd1
commit 21c4f44d4e
121 changed files with 987 additions and 837 deletions

View File

@@ -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('pdf: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('pdf: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('pdf:compressPdf.lowCompression'),
description: t('pdf:compressPdf.lowCompressionDescription')
},
{
value: 'medium',
label: t('pdf.compressPdf.mediumCompression'),
description: t('pdf.compressPdf.mediumCompressionDescription')
label: t('pdf:compressPdf.mediumCompression'),
description: t('pdf:compressPdf.mediumCompressionDescription')
},
{
value: 'high',
label: t('pdf.compressPdf.highCompression'),
description: t('pdf.compressPdf.highCompressionDescription')
label: t('pdf:compressPdf.highCompression'),
description: t('pdf:compressPdf.highCompressionDescription')
}
];
@@ -157,26 +157,26 @@ export default function CompressPdf({
value={input}
onChange={setInput}
accept={['application/pdf']}
title={t('pdf.compressPdf.inputTitle')}
title={t('pdf:compressPdf.inputTitle')}
/>
}
resultComponent={
<ToolFileResult
title={t('pdf.compressPdf.resultTitle')}
title={t('pdf:compressPdf.resultTitle')}
value={result}
extension={'pdf'}
loading={isProcessing}
loadingText={t('pdf.compressPdf.compressingPdf')}
loadingText={t('pdf:compressPdf.compressingPdf')}
/>
}
getGroups={({ values, updateField }) => [
{
title: t('pdf.compressPdf.compressionSettings'),
title: t('pdf:compressPdf.compressionSettings'),
component: (
<Box>
<Box>
<Typography variant="subtitle2" sx={{ mb: 1 }}>
{t('pdf.compressPdf.compressionLevel')}
{t('pdf:compressPdf.compressionLevel')}
</Typography>
{compressionOptions.map((option) => (
@@ -201,16 +201,16 @@ export default function CompressPdf({
}}
>
<Typography variant="body2">
{t('pdf.compressPdf.fileSize')}:{' '}
{t('pdf:compressPdf.fileSize')}:{' '}
<strong>{fileInfo.size}</strong>
</Typography>
<Typography variant="body2">
{t('pdf.compressPdf.pages')}:{' '}
{t('pdf:compressPdf.pages')}:{' '}
<strong>{fileInfo.pages}</strong>
</Typography>
{resultSize && (
<Typography variant="body2">
{t('pdf.compressPdf.compressedFileSize')}:{' '}
{t('pdf:compressPdf.compressedFileSize')}:{' '}
<strong>{resultSize}</strong>
</Typography>
)}

View File

@@ -26,8 +26,8 @@ export const tool = defineTool('pdf', {
'Compress PDF files securely in your browser using Ghostscript. Your files never leave your device, ensuring complete privacy while reducing file sizes for email sharing, uploading to websites, or saving storage space. Powered by WebAssembly technology.',
component: lazy(() => import('./index')),
i18n: {
name: 'pdf.compressPdf.name',
description: 'pdf.compressPdf.description',
shortDescription: 'pdf.compressPdf.shortDescription'
name: 'pdf:compressPdf.title',
description: 'pdf:compressPdf.description',
shortDescription: 'pdf:compressPdf.shortDescription'
}
});

View File

@@ -44,23 +44,23 @@ export default function MergePdf({ title }: ToolComponentProps) {
setInput(pdfInputs);
}}
accept={['application/pdf']}
title={t('pdf.merge.inputTitle')}
title={t('pdf:merge.inputTitle')}
type="pdf"
/>
}
getGroups={null}
resultComponent={
<ToolFileResult
title={t('pdf.merge.resultTitle')}
title={t('pdf:merge.resultTitle')}
value={result}
extension={'pdf'}
loading={isProcessing}
loadingText={t('pdf.merge.loadingText')}
loadingText={t('pdf:merge.loadingText')}
/>
}
toolInfo={{
title: t('pdf.merge.toolInfo.title'),
description: t('pdf.merge.toolInfo.description')
title: t('pdf:merge.toolInfo.title'),
description: t('pdf:merge.toolInfo.description')
}}
/>
);

View File

@@ -10,8 +10,8 @@ export const meta = defineTool('pdf', {
keywords: ['pdf', 'merge', 'extract', 'pages', 'combine', 'document'],
path: 'merge-pdf',
i18n: {
name: 'pdf.mergePdf.name',
description: 'pdf.mergePdf.description',
shortDescription: 'pdf.mergePdf.shortDescription'
name: 'pdf:mergePdf.title',
description: 'pdf:mergePdf.description',
shortDescription: 'pdf:mergePdf.shortDescription'
}
});

View File

@@ -11,8 +11,8 @@ export const meta = defineTool('pdf', {
keywords: ['pdf', 'epub', 'convert', 'ebook'],
path: 'pdf-to-epub',
i18n: {
name: 'pdf.pdfToEpub.name',
description: 'pdf.pdfToEpub.description',
shortDescription: 'pdf.pdfToEpub.shortDescription'
name: 'pdf:pdfToEpub.title',
description: 'pdf:pdfToEpub.description',
shortDescription: 'pdf:pdfToEpub.shortDescription'
}
});

View File

@@ -25,8 +25,8 @@ export const tool = defineTool('pdf', {
'Add password protection to your PDF files securely in your browser. Your files never leave your device, ensuring complete privacy while securing your documents with password encryption. Perfect for protecting sensitive information, confidential documents, or personal data.',
component: lazy(() => import('./index')),
i18n: {
name: 'pdf.protectPdf.name',
description: 'pdf.protectPdf.description',
shortDescription: 'pdf.protectPdf.shortDescription'
name: 'pdf:protectPdf.title',
description: 'pdf:protectPdf.description',
shortDescription: 'pdf:protectPdf.shortDescription'
}
});

View File

@@ -92,7 +92,7 @@ export default function RotatePdf({
if (applyToAllPages) {
setPageRangePreview(
totalPages > 0
? t('pdf.rotatePdf.allPagesWillBeRotated', { count: totalPages })
? t('pdf: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('pdf: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('pdf:rotatePdf.angleOptions.clockwise90') },
{ value: 180, label: t('pdf:rotatePdf.angleOptions.upsideDown180') },
{ value: 270, label: t('pdf:rotatePdf.angleOptions.counterClockwise270') }
];
return (
<ToolContent
@@ -142,25 +142,25 @@ export default function RotatePdf({
value={input}
onChange={setInput}
accept={['application/pdf']}
title={t('pdf.rotatePdf.inputTitle')}
title={t('pdf:rotatePdf.inputTitle')}
/>
}
resultComponent={
<ToolFileResult
title={t('pdf.rotatePdf.resultTitle')}
title={t('pdf:rotatePdf.resultTitle')}
value={result}
extension={'pdf'}
loading={isProcessing}
loadingText={t('pdf.rotatePdf.rotatingPages')}
loadingText={t('pdf:rotatePdf.rotatingPages')}
/>
}
getGroups={({ values, updateField }) => [
{
title: t('pdf.rotatePdf.rotationSettings'),
title: t('pdf:rotatePdf.rotationSettings'),
component: (
<Box>
<Typography variant="subtitle2" sx={{ mb: 1 }}>
{t('pdf.rotatePdf.rotationAngle')}
{t('pdf:rotatePdf.rotationAngle')}
</Typography>
{angleOptions.map((angleOption) => (
<SimpleRadio
@@ -183,7 +183,7 @@ export default function RotatePdf({
}}
/>
}
label={t('pdf.rotatePdf.applyToAllPages')}
label={t('pdf:rotatePdf.applyToAllPages')}
/>
</Box>
@@ -191,7 +191,7 @@ export default function RotatePdf({
<Box sx={{ mt: 2 }}>
{totalPages > 0 && (
<Typography variant="body2" sx={{ mb: 1 }}>
{t('pdf.rotatePdf.pdfPageCount', { count: totalPages })}
{t('pdf:rotatePdf.pdfPageCount', { count: totalPages })}
</Typography>
)}
<TextFieldWithDesc
@@ -199,8 +199,8 @@ export default function RotatePdf({
onOwnChange={(val) => {
updateField('pageRanges', val);
}}
description={t('pdf.rotatePdf.pageRangesDescription')}
placeholder={t('pdf.rotatePdf.pageRangesPlaceholder')}
description={t('pdf:rotatePdf.pageRangesDescription')}
placeholder={t('pdf:rotatePdf.pageRangesPlaceholder')}
/>
{pageRangePreview && (
<Typography
@@ -218,8 +218,8 @@ export default function RotatePdf({
]}
onValuesChange={onValuesChange}
toolInfo={{
title: t('pdf.rotatePdf.toolInfo.title'),
description: t('pdf.rotatePdf.toolInfo.description')
title: t('pdf:rotatePdf.toolInfo.title'),
description: t('pdf:rotatePdf.toolInfo.description')
}}
/>
);

View File

@@ -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('pdf: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('pdf:splitPdf.inputTitle')}
/>
}
resultComponent={
<ToolFileResult
title={t('pdf.splitPdf.resultTitle')}
title={t('pdf:splitPdf.resultTitle')}
value={result}
extension={'pdf'}
loading={isProcessing}
loadingText={t('pdf.splitPdf.extractingPages')}
loadingText={t('pdf:splitPdf.extractingPages')}
/>
}
getGroups={({ values, updateField }) => [
{
title: t('pdf.splitPdf.pageSelection'),
title: t('pdf:splitPdf.pageSelection'),
component: (
<Box>
{totalPages > 0 && (
<Typography variant="body2" sx={{ mb: 1 }}>
{t('pdf.splitPdf.pdfPageCount', { count: totalPages })}
{t('pdf:splitPdf.pdfPageCount', { count: totalPages })}
</Typography>
)}
<TextFieldWithDesc
@@ -145,8 +145,8 @@ export default function SplitPdf({ title }: ToolComponentProps) {
onOwnChange={(val) => {
updateField('pageRanges', val);
}}
description={t('pdf.splitPdf.pageRangesDescription')}
placeholder={t('pdf.splitPdf.pageRangesPlaceholder')}
description={t('pdf:splitPdf.pageRangesDescription')}
placeholder={t('pdf:splitPdf.pageRangesPlaceholder')}
/>
{pageRangePreview && (
<Typography
@@ -162,8 +162,8 @@ export default function SplitPdf({ title }: ToolComponentProps) {
]}
onValuesChange={onValuesChange}
toolInfo={{
title: t('pdf.splitPdf.toolInfo.title'),
description: t('pdf.splitPdf.toolInfo.description')
title: t('pdf:splitPdf.toolInfo.title'),
description: t('pdf:splitPdf.toolInfo.description')
}}
/>
);

View File

@@ -11,8 +11,8 @@ export const meta = defineTool('pdf', {
keywords: ['pdf', 'split', 'extract', 'pages', 'range', 'document'],
path: 'split-pdf',
i18n: {
name: 'pdf.splitPdf.name',
description: 'pdf.splitPdf.description',
shortDescription: 'pdf.splitPdf.shortDescription'
name: 'pdf:splitPdf.title',
description: 'pdf:splitPdf.description',
shortDescription: 'pdf:splitPdf.shortDescription'
}
});