View Single Post
EmaNymton's Avatar
Posts: 141 | Thanked: 267 times | Joined on May 2010 @ Germany
#5
Thanks for the suggestion with the script, the version of pyside generated ts-file and lupdate are different (1.1 and 2.0). So I tried to change 1.1 to 2.0 by hand but the same outcome. I checked the PyQt lupdate and the ts-versions are the same, but the same result.

Code:
pylupdate4 version 4.8.1
pyside-lupdate version 4.8.0
lupdate Version 4.8.1
Funnily the generated headers of the files contains different line breaks, so you have to adapt the script a little bit (+4 should be +3).

lupdate
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
...
pylupdate4
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="2.0">
...
pyside-lupdate
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="1.1">
...
Because I'm not so good at bash scripting (tail and head don't change the ts.file, right?) I wrote a python script for myself that I will use.
Code:
#!/usr/bin/python
#-*- coding: utf-8 -*-
import os
os.system('lupdate qml/* -ts lupdate.ts')
os.system('pyside-lupdate main.py -ts pylupdate.ts')
with open('lupdate.ts','r') as lupdate:
    lines_lupdate = lupdate.readlines()
with open('pylupdate.ts','r') as pylupdate:
    lines_pylupdate = pylupdate.readlines()
with open('base.ts','w') as base:
    base.write(''.join(lines_lupdate[:-1]+lines_pylupdate[2:]))
os.system('rm lupdate.ts pylupdate.ts')
Thanks for your help!