summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-01-27 16:54:22 +0100
committerArne Schwabe <arne@rfc2549.org>2013-01-27 16:54:22 +0100
commit3206c7fdf6ab364856ceacfd5212e230a44ef1dd (patch)
tree89b17a3a578cb6660c033da95aba73e785bbdf9c
parent3086a2e1a1d13e44539fee75fad8feacce36b20f (diff)
Make FAQ Wiki code nicer
-rwxr-xr-xgenFAQ.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/genFAQ.py b/genFAQ.py
index 1815f7a2..0556c1bc 100755
--- a/genFAQ.py
+++ b/genFAQ.py
@@ -16,10 +16,18 @@ This page is autogenerated. Do not edit
"""
def getString(strid,lang):
+ ostr=""
if strid in strres[lang]:
- return strres[lang][strid]
+ ostr=strres[lang][strid]
else:
- return strres["default"][strid]
+ ostr=strres["default"][strid]
+
+ ostr = ostr.replace("&lt;","<")
+ ostr = ostr.replace("&gt;",">")
+ ostr = ostr.replace("\\\"","\"")
+ ostr = ostr.replace("\\'","'")
+ ostr = ostr.replace("\\n","<p>")
+ return ostr
def genPage(faqdom,lang):
out =""
@@ -75,6 +83,7 @@ def main():
for directory in os.listdir("res"):
if directory.startswith("values-"):
lang = directory.split("-",1)[1]
+ print lang
loadstrres("res/values-%s/strings.xml" % lang,lang)
langdir= "%s/%s" %(faqpath,lang)
@@ -87,7 +96,6 @@ def main():
if not os.path.exists(langdir):
os.mkdir(langdir)
- print lang
faq= genPage(faqdom,lang)
open("%s/FAQ.wiki" % langdir,"w").write(faq.encode("utf-8"))