From 747ea92cbcd4ea3a8aa4a8e1ce22b49e79034a7d Mon Sep 17 00:00:00 2001 From: Chesterkxng Date: Mon, 16 Mar 2026 15:39:28 +0100 Subject: [PATCH] chore: fix translation scope and complete i18n support - Apply useTranslation to converters instead of audio - Add missing translation keys for full i18n coverage --- public/locales/en/converters.json | 8 ++++-- .../converters/audio-converter/index.tsx | 27 ++++++------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/public/locales/en/converters.json b/public/locales/en/converters.json index eb48c4d..584a717 100644 --- a/public/locales/en/converters.json +++ b/public/locales/en/converters.json @@ -1,8 +1,12 @@ { - "audioconverter": { + "audioConverter": { "title": "Audio Converter", "description": "Convert audio files between different formats.", "shortDescription": "Convert audio files to various formats.", - "longDescription": "This tool allows you to convert audio files from one format to another, supporting a wide range of audio formats for seamless conversion." + "longDescription": "This tool allows you to convert audio files from one format to another, supporting a wide range of audio formats for seamless conversion.", + "outputFormat": "output Format", + "outputFormatDescription": "Select the desired output audio format", + "inputTitle": "Audio Input", + "outputTitle": "Converted Audio" } } diff --git a/src/pages/tools/converters/audio-converter/index.tsx b/src/pages/tools/converters/audio-converter/index.tsx index 1654bf7..a77c26e 100644 --- a/src/pages/tools/converters/audio-converter/index.tsx +++ b/src/pages/tools/converters/audio-converter/index.tsx @@ -14,11 +14,8 @@ const initialValues: InitialValuesType = { outputFormat: 'mp3' }; -export default function AudioConverter({ - title, - longDescription -}: ToolComponentProps) { - const { t } = useTranslation('audio'); +export default function AudioConverter({ title }: ToolComponentProps) { + const { t } = useTranslation('converters'); const [input, setInput] = useState(null); const [result, setResult] = useState(null); const [loading, setLoading] = useState(false); @@ -47,12 +44,7 @@ export default function AudioConverter({ updateField }) => [ { - id: 'output-format', - title: t('audioConverter.outputFormat', 'Output Format'), - description: t( - 'audioConverter.outputFormatDescription', - 'Select the desired output audio format' - ), + title: t('audioConverter.outputFormat'), component: ( ) @@ -80,13 +69,13 @@ export default function AudioConverter({ } resultComponent={ } @@ -95,8 +84,8 @@ export default function AudioConverter({ setInput={setInput} compute={compute} toolInfo={{ - title: `What is a ${title}?`, - description: longDescription + title: t('audioConverter.title'), + description: t('audioConverter.longDescription') }} /> );