mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-30 19:40:18 -07:00
- Added some scripts that might be useful in the future
This commit is contained in:
parent
c146f6d0d9
commit
7f7fb2354f
2 changed files with 43 additions and 0 deletions
19
src/convertPOtoTS.py
Normal file
19
src/convertPOtoTS.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
|
||||
LANG_FOLDER = "lang/"
|
||||
PO_FOLDER = 'po_files'
|
||||
|
||||
if __name__ == '__main__':
|
||||
po_files = os.listdir(os.path.join(LANG_FOLDER, PO_FOLDER))
|
||||
po_files = [x for x in po_files if os.path.splitext(x)[-1] == ".po"]
|
||||
for file in po_files:
|
||||
# First clean up the ts file
|
||||
ts_file = os.path.join(LANG_FOLDER, os.path.splitext(file)[0]+'.ts')
|
||||
po_file = os.path.join(LANG_FOLDER, PO_FOLDER, file)
|
||||
if os.path.exists(ts_file):
|
||||
os.remove(ts_file)
|
||||
# Convert to PO
|
||||
print "Converting %s..." % (po_file,)
|
||||
os.system("po2ts %s -o %s" % (po_file, ts_file))
|
Loading…
Add table
Add a link
Reference in a new issue