summaryrefslogtreecommitdiff
path: root/bin/tools/translate.py
diff options
context:
space:
mode:
authorhda (Tiny) <hda@tinyerp.com>2009-12-08 15:42:46 +0530
committerhda (Tiny) <hda@tinyerp.com>2009-12-08 15:42:46 +0530
commit24cd74becf6df66c71cdafc9f8a41ffdde903aec (patch)
treecf195d12fdbdbeadd6de930c93e54b01fa959a23 /bin/tools/translate.py
parenta481bfb190667cd2fcb6335adf533afe6e1c8e2d (diff)
parent474af4cd6e6f00759589c4bee9cebf9d7d26b0d8 (diff)
Merge
bzr revid: hda@tinyerp.com-20091208101246-5ave2zzgzsjqf0m8
Diffstat (limited to 'bin/tools/translate.py')
-rw-r--r--bin/tools/translate.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/bin/tools/translate.py b/bin/tools/translate.py
index e41a5d99217..7aa96ece5d4 100644
--- a/bin/tools/translate.py
+++ b/bin/tools/translate.py
@@ -348,9 +348,9 @@ def trans_export(lang, modules, buffer, format, dbname=None):
def trans_parse_xsl(de):
res = []
- for n in [i for i in de.getchildren()]:
+ for n in de:
if n.get("t"):
- for m in [j for j in n.getchildren() if j.text]:
+ for m in [j for j in n if j.text]:
l = m.text.strip().replace('\n',' ')
if len(l):
res.append(l.encode("utf8"))
@@ -359,8 +359,8 @@ def trans_parse_xsl(de):
def trans_parse_rml(de):
res = []
- for n in [i for i in de.getchildren()]:
- for m in [j for j in n.getchildren() if j.text]:
+ for n in de:
+ for m in [j for j in n if j.text]:
string_list = [s.replace('\n', ' ').strip() for s in re.split('\[\[.+?\]\]', m.text)]
for s in string_list:
if s:
@@ -371,14 +371,10 @@ def trans_parse_rml(de):
def trans_parse_view(de):
res = []
if de.get("string"):
- s = de.get('string')
- if s:
- res.append(s.encode("utf8"))
+ res.append(de.get('string').encode("utf8"))
if de.get("sum"):
- s = de.get('sum')
- if s:
- res.append(s.encode("utf8"))
- for n in [i for i in de.getchildren()]:
+ res.append(de.get('sum').encode("utf8"))
+ for n in de:
res.extend(trans_parse_view(n))
return res