| 123456789101112131415161718192021 |
- const fs = require('fs');
- const path = require('path');
- const translationsPath = path.join('d:', 'workspace', 'AuraK', 'web', 'utils', 'translations.ts');
- let content = fs.readFileSync(translationsPath, 'utf8');
- // Fix the specific syntax error first: key: , -> key: "key",
- const lines = content.split('\n');
- const fixedLines = lines.map(line => {
- const match = line.match(/^(\s+)(["']?[a-zA-Z0-9_-]+["']?):\s*,/);
- if (match) {
- const indent = match[1];
- const key = match[2].replace(/['"]/g, '');
- return `${indent}${match[2]}: "${key}",`;
- }
- return line;
- });
- fs.writeFileSync(translationsPath, fixedLines.join('\n'), 'utf8');
- console.log('Fixed empty values in translations.ts!');
|