mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-23 00:43:28 +00:00
Fix performance bug in xml2po whcih may save users a few hours of
build time. Approved by: portmgr (marcus)
This commit is contained in:
parent
55b920778d
commit
5667504a84
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=175406
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
PORTNAME= gnome-doc-utils
|
PORTNAME= gnome-doc-utils
|
||||||
PORTVERSION= 0.7.2
|
PORTVERSION= 0.7.2
|
||||||
|
PORTREVISION= 1
|
||||||
CATEGORIES= textproc gnome
|
CATEGORIES= textproc gnome
|
||||||
MASTER_SITES= ${MASTER_SITE_GNOME}
|
MASTER_SITES= ${MASTER_SITE_GNOME}
|
||||||
MASTER_SITE_SUBDIR= sources/gnome-doc-utils/0.7
|
MASTER_SITE_SUBDIR= sources/gnome-doc-utils/0.7
|
||||||
|
41
textproc/gnome-doc-utils/files/patch-xml2po__xml2po.py
Normal file
41
textproc/gnome-doc-utils/files/patch-xml2po__xml2po.py
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
--- xml2po/xml2po.py.orig Sun Apr 2 03:47:17 2006
|
||||||
|
+++ xml2po/xml2po.py Fri Oct 20 00:57:46 2006
|
||||||
|
@@ -242,14 +242,10 @@
|
||||||
|
text = normalizeString(text, not spacepreserve)
|
||||||
|
if (text.strip() == ''):
|
||||||
|
return text
|
||||||
|
- file = open(mofile, "rb")
|
||||||
|
- if file:
|
||||||
|
- myfallback = NoneTranslations()
|
||||||
|
- gt = gettext.GNUTranslations(file)
|
||||||
|
- gt.add_fallback(myfallback)
|
||||||
|
- if gt:
|
||||||
|
- res = gt.ugettext(text.decode('utf-8'))
|
||||||
|
- return res
|
||||||
|
+ global gt
|
||||||
|
+ if gt:
|
||||||
|
+ res = gt.ugettext(text.decode('utf-8'))
|
||||||
|
+ return res
|
||||||
|
|
||||||
|
return text
|
||||||
|
|
||||||
|
@@ -648,6 +644,7 @@
|
||||||
|
filename = ''
|
||||||
|
origxml = ''
|
||||||
|
mofile = ''
|
||||||
|
+gt = None
|
||||||
|
ultimate = [ ]
|
||||||
|
ignored = [ ]
|
||||||
|
filenames = [ ]
|
||||||
|
@@ -763,6 +760,11 @@
|
||||||
|
if mode=='merge' and mofile=='':
|
||||||
|
print >> sys.stderr, "Error: You must specify MO file when merging translations."
|
||||||
|
sys.exit(3)
|
||||||
|
+
|
||||||
|
+file = open(mofile, "rb")
|
||||||
|
+if file:
|
||||||
|
+ gt = gettext.GNUTranslations(file)
|
||||||
|
+ gt.add_fallback(NoneTranslations())
|
||||||
|
|
||||||
|
ultimate_tags = read_finaltags(ultimate)
|
||||||
|
ignored_tags = read_ignoredtags(ignored)
|
Loading…
Reference in New Issue
Block a user