[gimp-help-2] Enable translation of xreflabel attributes
- From: Ulf-D. Ehlert <ulfehlert src gnome org>
- To: svn-commits-list gnome org
- Subject: [gimp-help-2] Enable translation of xreflabel attributes
- Date: Tue, 28 Jul 2009 18:25:14 +0000 (UTC)
commit c98c2b1aa723868ae4eaa6d35d5b9486897cb1e2
Author: Ulf-D. Ehlert <ulfehlert svn gnome org>
Date: Mon Jul 27 21:05:25 2009 +0200
Enable translation of xreflabel attributes
This includes bugfixes for xml2po.
tools/xml2po | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/tools/xml2po b/tools/xml2po
index 87c6a7b..220f8ba 100755
--- a/tools/xml2po
+++ b/tools/xml2po
@@ -453,13 +453,12 @@ def worthOutputting(node):
return worth
def processAttribute(node, attr):
- if not node or not attr or not worthOutputting(node):
- return
-
+ assert node and attr
outtxt = attr.content
if mode=='merge':
- translation = getTranslation(outtxt, 0)
- replaceAttributeContentsWithText(attr, translation.encode('utf-8'))
+ translation = getTranslation(outtxt, 0) # may be None
+ if translation:
+ replaceAttributeContentsWithText(attr, translation.encode('utf-8'))
else:
msg.outputMessage(outtxt, node.lineNo(), "", 0,
node.name + ":" + attr.name)
@@ -601,9 +600,11 @@ def read_ignoredtags(filelist):
def read_treatedattributes(filelist):
if CurrentXmlMode:
- return CurrentXmlMode.getTreatedAttributes()
+ # FIXME: this is a workaround for gimp-help-2, the correct
+ # way is to use a specialized module.
+ return ["xreflabel"] + CurrentXmlMode.getTreatedAttributes()
else:
- return []
+ return ["xreflabel"]
def tryToUpdate(allargs, lang):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]