diff --git a/scripts/extract-tools-strings.mjs b/scripts/extract-tools-strings.mjs index 9d2e4b52..2766c915 100644 --- a/scripts/extract-tools-strings.mjs +++ b/scripts/extract-tools-strings.mjs @@ -48,9 +48,22 @@ function processVueComponent(filePath, toolName) { return `${attr}: t('tools.${toolName}.texts.${key}')`; }); + if (content.includes("/* NO EXTRACT SCRIPT */")) { + console.log(`Marked to not extract: ${filePath}`); + return; + } + + const hasAlreayI18n = filePath.endsWith('.vue') + ? content.includes("const { t } = useI18n();") + : content.includes("import { translate as t } from '@/plugins/i18n.plugin';"); + if (hasAlreayI18n) { + console.log(`Already extracted: ${filePath}`); + return; + } + if (filePath.endsWith('.vue')) { // Regex to find label or placeholder attributes - regex = /(? { if (!text?.trim()) { return match; @@ -88,13 +101,13 @@ function processVueComponent(filePath, toolName) { if (filePath.endsWith('.vue')) { // Ensure the useI18n import exists - if (!content.includes("const { t } = useI18n();")) { + if (!hasAlreayI18n) { content = content.replace(/\ diff --git a/src/tools/spf-dns-generator/spf-dns-generator.vue b/src/tools/spf-dns-generator/spf-dns-generator.vue index a3b67852..4cf837d4 100644 --- a/src/tools/spf-dns-generator/spf-dns-generator.vue +++ b/src/tools/spf-dns-generator/spf-dns-generator.vue @@ -1,4 +1,5 @@