From 19a61f16c8caeb18559a510f2bc5f40a3f4a97cc Mon Sep 17 00:00:00 2001 From: ShareVB Date: Fri, 13 Feb 2026 13:17:27 +0100 Subject: [PATCH] feat(Scripts): extract externAccessDescription --- scripts/extract-tools-desc.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/extract-tools-desc.mjs b/scripts/extract-tools-desc.mjs index f61c0290..45ef29b9 100644 --- a/scripts/extract-tools-desc.mjs +++ b/scripts/extract-tools-desc.mjs @@ -18,6 +18,7 @@ function processFile(filePath) { // Extract existing name and description values const nameMatch = originalContent.match(/name: '(.*?)'/); const descriptionMatch = originalContent.match(/description: '(.*?)'/); + const externAccessDescriptionMatch = originalContent.match(/externAccessDescription: '(.*?)'/); if (!nameMatch || !descriptionMatch) { console.warn(`Skipping ${filePath}: Unable to extract name or description.`); @@ -26,11 +27,13 @@ function processFile(filePath) { const nameValue = nameMatch[1]; const descriptionValue = descriptionMatch[1]; + const externAccessDescriptionValue = externAccessDescriptionMatch ? externAccessDescriptionMatch[1] : null; // Modify name and description to use the translate function const transformedContent = originalContent .replace(/name: '((?:[^']+|(?<=\\)')+)'/, `name: t('tools.${parentDir}.title')`) - .replace(/description: '((?:[^']+|(?<=\\)')+)'/, `description: t('tools.${parentDir}.description')`); + .replace(/description: '((?:[^']+|(?<=\\)')+)'/, `description: t('tools.${parentDir}.description')`) + .replace(/externAccessDescription: '((?:[^']+|(?<=\\)')+)'/, `externAccessDescription: t('tools.${parentDir}.externalAccess')`); fs.writeFileSync(filePath, `import { translate as t } from '@/plugins/i18n.plugin';\n${transformedContent}`, 'utf-8'); console.log(`Transformed: ${filePath}`); @@ -43,6 +46,7 @@ function processFile(filePath) { ...localesData.tools[parentDir], title: nameValue, description: descriptionValue, + externalAccess: externAccessDescriptionValue, }; }