Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyQt5 translation: is it possible to run pylupdate5 from Python?

I have some PyQt5 application with some tr() translations in it. I have a Python script that compiles UI forms and resources, and I want it to also update the ts file with translations, because it's a bit annoying to run pylupdate manually each time.

Alas, I haven't find any information, how to run the Python functions that provide translation file compilation in PyQt5. Haven't you ever got the same problem?

like image 365
Felix Avatar asked Sep 16 '25 20:09

Felix


1 Answers

I was able to do it like this

import os
ret = os.system("E:\Anaconda3\Library\\bin\\pylupdate5.exe -verbose Main.py otherfile.py thirdfile.py -ts zh_CN.ts")

Hopefully you found it as well

like image 72
Faller Avatar answered Sep 19 '25 04:09

Faller