chanjunkai 5 years ago
parent
commit
3c4fafb9e8
1 changed files with 2 additions and 1 deletions
  1. 2 1
      controller/LangArea.py

+ 2 - 1
controller/LangArea.py

@@ -172,7 +172,8 @@ class LangAreaView(TemplateView):
                 lk = lk.replace('‘', '_')
                 # 正则表达式
                 # re.sub("[a-z]+", "$", "123abc78ab9cdeg00t8")
-                content = content + '<string name="' + lk + '">' + res[l] + '</string>\n'
+                content_val = res[l].replace("'","\\'")
+                content = content + '<string name="' + lk + '">' + content_val + '</string>\n'
         response = StreamingHttpResponse(content)
         response['Content-Type'] = 'application/octet-stream'
         response['Content-Disposition'] = 'attachment;filename="lang.txt"'