|
2012-12-11
, 17:44
|
Posts: 435 |
Thanked: 769 times |
Joined on Apr 2010
|
#2
|
The Following User Says Thank You to gionni88 For This Useful Post: | ||
|
2012-12-11
, 19:22
|
|
Posts: 141 |
Thanked: 267 times |
Joined on May 2010
@ Germany
|
#3
|
pyside-lupdate -verbose main.py -ts base.ts Updating 'base.ts'... Found 3 source texts (3 new and 0 already existing) Kept 0 obsolete translations Removed 26 obsolete untranslated entries
lupdate qml/* -ts base.ts Bringe 'base.ts' auf aktuellen Stand... Found 26 source text(s) (26 new and 0 already existing) Kept 3 obsolete entries
|
2012-12-12
, 08:09
|
Posts: 435 |
Thanked: 769 times |
Joined on Apr 2010
|
#4
|
pyside-lupdate main.py -ts temp.ts tail -n +4 temp.ts lupdate qml/* -ts base.ts head -n -1 base.ts cat temp.ts >> base.ts
The Following User Says Thank You to gionni88 For This Useful Post: | ||
|
2012-12-12
, 09:25
|
|
Posts: 141 |
Thanked: 267 times |
Joined on May 2010
@ Germany
|
#5
|
pylupdate4 version 4.8.1 pyside-lupdate version 4.8.0 lupdate Version 4.8.1
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0"> ...
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS><TS version="2.0"> ...
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS><TS version="1.1"> ...
#!/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')
I have projects with both qml and python-files which contains strings, that should be translated.
There are tools for generating a ts-file for python-files (pyside-lupdate) and qml-files (lupdate) and they work fine for their own files but not for the others.
So every time I change something, I have to generate two seperate ts-files and merge the two ts-files by hand.
Call me lazy, but if there is a way to do it in one step, please let me know
EmaNymton