Selaa lähdekoodia

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

chanjunkai 5 vuotta sitten
vanhempi
commit
7cfe12ab2b
1 muutettua tiedostoa jossa 4 lisäystä ja 6 poistoa
  1. 4 6
      controller/LangArea.py

+ 4 - 6
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,13 +170,11 @@ class LangAreaView(TemplateView):
                 lk = lk.replace('%', '_')
                 lk = lk.replace(';', '_')
                 lk = lk.replace('‘', '_')
-                T = res[l]
-                T.replace('"', '\\"')
-                res[l] = T
-                print(res[l])
+
                 # 正则表达式
                 # 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'