pengzhibo168 5 tahun lalu
induk
melakukan
a1dce18e53
1 mengubah file dengan 2 tambahan dan 4 penghapusan
  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'