diff --git a/po/xml2po-python3.py b/po/xml2po-python3.py index 18759161218..5e20823992e 100644 --- a/po/xml2po-python3.py +++ b/po/xml2po-python3.py @@ -32,7 +32,7 @@ def startElement(self, name, attrs): k = attrs[x] if k.strip() != "" and not self.ishex.match(k): if x == "context": - attrlist.add((re.sub(r"(\w)([A-Z])([a-z])", r"\1 \2\3", k), self.last_comment)) + attrlist.add((re.sub(r"(?:(?=(?<=[^A-Z])[A-Z])|(?=Actions|Select))(?!(?<=Pi)P)", " ", k), self.last_comment)) else: attrlist.add((k, self.last_comment)) self.last_comment = None diff --git a/po/xml2po.py b/po/xml2po.py index 099a631f609..3937ddd67c9 100644 --- a/po/xml2po.py +++ b/po/xml2po.py @@ -36,7 +36,7 @@ def startElement(self, name, attrs): k = ktmp.decode() if k.strip() != "" and not self.ishex.match(k): if x == "context": - attrlist.add((re.sub(r"(\w)([A-Z])([a-z])", r"\1 \2\3", k), self.last_comment)) + attrlist.add((re.sub(r"(?:(?=(?<=[^A-Z])[A-Z])|(?=Actions|Select))(?!(?<=Pi)P)", " ", k), self.last_comment)) else: attrlist.add((k, self.last_comment)) self.last_comment = None