mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Look for Qt translations in the right place on Mandriva
This commit is contained in:
parent
917cbdf348
commit
8e964de8c4
10
resources.py
10
resources.py
@ -22,7 +22,8 @@ def main(args=sys.argv):
|
||||
bytes = repr(open(path, 'rb').read())
|
||||
data += key + ' = ' + bytes + '\n\n'
|
||||
|
||||
TPATH = '/usr/share/qt4/translations'
|
||||
translations_found = False
|
||||
for TPATH in ('/usr/share/qt4/translations', '/usr/lib/qt4/translations'):
|
||||
if os.path.exists(TPATH):
|
||||
files = glob.glob(TPATH + '/qt_??.qm')
|
||||
|
||||
@ -30,9 +31,10 @@ def main(args=sys.argv):
|
||||
key = os.path.basename(f).partition('.')[0]
|
||||
bytes = repr(open(f, 'rb').read())
|
||||
data += key + ' = ' + bytes + '\n\n'
|
||||
|
||||
else:
|
||||
print 'WARNING: Could not find Qt transations in', TPATH
|
||||
translations_found = True
|
||||
break
|
||||
if not translations_found:
|
||||
print 'WARNING: Could not find Qt transations'
|
||||
|
||||
open('src'+os.sep+__appname__+os.sep+'/resources.py', 'wb').write(data)
|
||||
return 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user