const fs = require('fs'); const filePath = 'c:\\Users\\12914\\Desktop\\vscode\\chunyu_prject_react\\src\\locales\\zh.json'; let content = fs.readFileSync(filePath, 'utf8'); // Replace the exact line - line 2335 contains unescaped regular quotes inside a string // "text": "点击"示例"按钮可快速加载对应语言的示例代码进行体验。" // Should use Chinese curly quotes 「」 or escape, let's use Chinese quotes 「示例」 const lines = content.split('\n'); console.log('Line 2335 before:', lines[2334]); // The problematic line: "text": "点击"示例"按钮可快速加载对应语言的示例代码进行体验。" // Replace with proper escaping or curly quotes lines[2334] = ' "text": "点击「示例」按钮可快速加载对应语言的示例代码进行体验。"'; console.log('Line 2335 after:', lines[2334]); const newContent = lines.join('\n'); fs.writeFileSync(filePath, newContent, 'utf8'); // Verify try { JSON.parse(fs.readFileSync(filePath, 'utf8')); console.log('zh.json is now VALID'); } catch(e) { console.log('Still INVALID:', e.message); }