|
@@ -33,7 +33,7 @@ function processFile(filePath) {
|
|
|
|
|
|
// 替换 <script> 中的内容
|
|
|
content = content.replace(scriptRegex, (match, scriptContent) => {
|
|
|
- return match.replace(/(['"])([\u4e00-\u9fa5]+)\1/g, (_, quote, text) => {
|
|
|
+ return match.replace(/(['"])([\u4e00-\u9fa5\u3000-\u303f\uff01-\uff5e\u201c-\u201d\u3008-\u3011]+)\1/g, (_, quote, text) => {
|
|
|
return replaceText(text, 'this.$t(\'$1\')');
|
|
|
});
|
|
|
});
|
|
@@ -52,7 +52,7 @@ function replaceText(text, replacementPattern) {
|
|
|
|
|
|
// 替换为指定的模式
|
|
|
const key = langData[text];
|
|
|
- return replacementPattern.replace('$1', key);
|
|
|
+ return replacementPattern.replace('$1', text);
|
|
|
}
|
|
|
|
|
|
// 遍历目录
|