diff --git a/src/plugins/i18n.plugin.ts b/src/plugins/i18n.plugin.ts index c179873d..fc0434cc 100644 --- a/src/plugins/i18n.plugin.ts +++ b/src/plugins/i18n.plugin.ts @@ -31,7 +31,7 @@ export const i18nPlugin: Plugin = { }, }; -export const translate = function (localeKey: string) { +export const translate = function (localeKey: string, named?: Record) { // @ts-expect-error global - return i18n.global.t(localeKey); + return i18n.global.t(localeKey, named); }; diff --git a/src/tools/base64-file-converter/base64-file-converter.vue b/src/tools/base64-file-converter/base64-file-converter.vue index 377625bd..248eaf7a 100644 --- a/src/tools/base64-file-converter/base64-file-converter.vue +++ b/src/tools/base64-file-converter/base64-file-converter.vue @@ -6,13 +6,15 @@ import { useDownloadFileFromBase64 } from '@/composable/downloadBase64'; import { useValidation } from '@/composable/validation'; import { isValidBase64 } from '@/utils/base64'; +const { t } = useI18n(); + const base64Input = ref(''); const { download } = useDownloadFileFromBase64({ source: base64Input }); const base64InputValidation = useValidation({ source: base64Input, rules: [ { - message: 'Invalid base 64 string', + message: t('tools.base64-file-converter.invalidMessage'), validator: value => isValidBase64(value.trim()), }, ], @@ -33,7 +35,7 @@ function downloadFile() { const fileInput = ref() as Ref; const { base64: fileBase64 } = useBase64(fileInput); -const { copy: copyFileBase64 } = useCopy({ source: fileBase64, text: 'Base64 string copied to the clipboard' }); +const { copy: copyFileBase64 } = useCopy({ source: fileBase64, text: t('tools.base64-file-converter.copied') }); async function onUpload(file: File) { if (file) { @@ -43,11 +45,11 @@ async function onUpload(file: File) {