Merge pull request #333 from wz-Tan/wz-Tan
fix: broken i18n meta tag for audio converter tool
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"audioConverter": {
|
||||
"title": "音频转换器",
|
||||
"description": "在不同格式之间转换音频文件。",
|
||||
"shortDescription": "将音频文件转换为各种格式。",
|
||||
"longDescription": "此工具允许您将音频文件从一种格式转换为另一种格式,支持多种音频格式的无缝转换。"
|
||||
}
|
||||
}
|
||||
Vendored
+2
@@ -12,6 +12,7 @@ import pdf from '../../public/locales/en/pdf.json';
|
||||
import audio from '../../public/locales/en/audio.json';
|
||||
import xml from '../../public/locales/en/xml.json';
|
||||
import image from '../../public/locales/en/image.json';
|
||||
import converters from '../../public/locales/en/converters.json';
|
||||
|
||||
declare module 'i18next' {
|
||||
interface CustomTypeOptions {
|
||||
@@ -28,6 +29,7 @@ declare module 'i18next' {
|
||||
audio: typeof audio;
|
||||
xml: typeof xml;
|
||||
image: typeof image;
|
||||
converters: typeof converters;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -15,7 +15,8 @@ export const validNamespaces = [
|
||||
'audio',
|
||||
'xml',
|
||||
'translation',
|
||||
'image'
|
||||
'image',
|
||||
'converters'
|
||||
] as const satisfies readonly Namespace[];
|
||||
|
||||
export type I18nNamespaces = (typeof validNamespaces)[number];
|
||||
|
||||
@@ -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<File | null>(null);
|
||||
const [result, setResult] = useState<File | null>(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: (
|
||||
<Box>
|
||||
<SelectWithDesc
|
||||
@@ -62,10 +54,7 @@ export default function AudioConverter({
|
||||
label: value.toUpperCase(),
|
||||
value: value as AudioFormat
|
||||
}))}
|
||||
description={t(
|
||||
'audioConverter.outputFormatDescription',
|
||||
'Select the desired output audio format'
|
||||
)}
|
||||
description={t('audioConverter.outputFormatDescription')}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
@@ -80,13 +69,13 @@ export default function AudioConverter({
|
||||
<ToolAudioInput
|
||||
value={input}
|
||||
onChange={setInput}
|
||||
title={t('audioConverter.uploadAudio', 'Upload Your Audio File')}
|
||||
title={t('audioConverter.inputTitle')}
|
||||
/>
|
||||
}
|
||||
resultComponent={
|
||||
<ToolFileResult
|
||||
value={result}
|
||||
title={t('audioConverter.outputTitle', 'Converted Audio')}
|
||||
title={t('audioConverter.outputTitle')}
|
||||
loading={loading}
|
||||
/>
|
||||
}
|
||||
@@ -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')
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -3,10 +3,10 @@ import { lazy } from 'react';
|
||||
|
||||
export const tool = defineTool('converters', {
|
||||
i18n: {
|
||||
name: 'translation:converters.audioconverter.title',
|
||||
description: 'translation:converters.audioconverter.description',
|
||||
shortDescription: 'translation:converters.audioconverter.shortDescription',
|
||||
longDescription: 'translation:converters.audioconverter.longDescription'
|
||||
name: 'converters:audioConverter.title',
|
||||
description: 'converters:audioConverter.description',
|
||||
shortDescription: 'converters:audioConverter.shortDescription',
|
||||
longDescription: 'converters:audioConverter.longDescription'
|
||||
},
|
||||
path: 'audio-converter',
|
||||
icon: 'mdi:music-note-outline',
|
||||
|
||||
Reference in New Issue
Block a user