瀏覽代碼

Merge branch 'master' of http://192.168.136.45:3000/SERVER/langer

chanjunkai 5 年之前
父節點
當前提交
ccf219a21f
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      controller/LangArea.py

+ 2 - 4
controller/LangArea.py

@@ -134,7 +134,7 @@ class LangAreaView(TemplateView):
                 elif en_kv[r['word_key']]:
                     res[r['word_key']] = en_kv[r['word_key']]
             for l in res:
-                content_val = res[l].replace('"', '\"')
+                content_val = res[l].replace('"', '\'')
                 content = content + '"' + l + '"="' + content_val + '";\n'
         elif type == 'android':
             res_qs = LangKeyModel.objects.filter(langvalmodel__la__id=id).\
@@ -170,11 +170,9 @@ class LangAreaView(TemplateView):
                 lk = lk.replace('%', '_')
                 lk = lk.replace(';', '_')
                 lk = lk.replace('‘', '_')
-
                 # 正则表达式
                 # re.sub("[a-z]+", "$", "123abc78ab9cdeg00t8")
-                content_val = res[l].replace("'", "\\'")
-                content_val = res[l].replace('"', '\\"')
+                content_val = res[l].replace("'","\\'")
                 content = content + '<string name="' + lk + '">' + content_val + '</string>\n'
         response = StreamingHttpResponse(content)
         response['Content-Type'] = 'application/octet-stream'