This commit is contained in:
Kovid Goyal 2012-12-16 00:20:49 +05:30
parent 238222608c
commit 6094c5e6d6

View File

@ -1034,7 +1034,7 @@ def build_forms(srcdir, info=None):
dat = dat.replace('from widgets import', 'from calibre.gui2.widgets import')
dat = dat.replace('from convert.xpath_wizard import',
'from calibre.gui2.convert.xpath_wizard import')
dat = re.sub(r'^ {4}def _translate\(.+:\s+return.*$', ' pass', dat,
dat = re.sub(r'^ {4}def _translate\(context, text, disambig\):\s+return.*$', ' pass', dat,
flags=re.M)
dat = re.compile(r'(?:QtGui.QApplication.translate|(?<!def )_translate)\(.+?,\s+"(.+?)(?<!\\)",.+?\)', re.DOTALL).sub(r'_("\1")', dat)
dat = dat.replace('_("MMM yyyy")', '"MMM yyyy"')