diff options
author | Arne Schwabe <arne@rfc2549.org> | 2013-01-27 16:54:22 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2013-01-27 16:54:22 +0100 |
commit | 3206c7fdf6ab364856ceacfd5212e230a44ef1dd (patch) | |
tree | 89b17a3a578cb6660c033da95aba73e785bbdf9c | |
parent | 3086a2e1a1d13e44539fee75fad8feacce36b20f (diff) |
Make FAQ Wiki code nicer
-rwxr-xr-x | genFAQ.py | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -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("<","<") + ostr = ostr.replace(">",">") + 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")) |