Browse Source

Update instructions about NSIS packaging

Include a helper a script to gather valid Qt translations for packaging.
adaptive-webui-19844
sledgehammer999 3 years ago
parent
commit
f35d94d98e
No known key found for this signature in database
GPG Key ID: 6E4A2D025B7CC9A2
  1. 10
      dist/windows/README.txt
  2. 31
      dist/windows/gather_qt_translations.py

10
dist/windows/README.txt vendored

@ -38,10 +38,12 @@ installer-translations @@ -38,10 +38,12 @@ installer-translations
translations
qt_ar.qm
...
(all the .qm files found in the 'translations' folder of your Qt install. Those files differ between Qt4 and Qt5.
If you want to distribute Qt4 translations it is better to use the ones found in this repo under the path "dist/qt-translations".
They contain extra languages not distributed via the official qt4 sources.
Don't forget to edit the filelist in installer.nsi + uninstaller.nsi to include all your .qm files.)
(All the .qm files found in the 'translations' folder of your Qt install. Those files differ between Qt5 and Qt6.
You will need the files that conform to this globbing expression 'qt_??.qm qt_??_??.qm qtbase_??.qm qtbase_??_??.qm'.
Some of those files will be stubs. Filter any file that is smaller than 10KB in size.
Alternatively you can use the 'gather_qt_translations.py' script found in the same folder as this file.
Run it with '--help' to see its usage.
**YOU MUST** edit the list of .qm files in the 'installer.nsi' to match whatever files are in the 'translations' subfolder.)
qt_zh_TW.qm
installer.nsi
license.txt

31
dist/windows/gather_qt_translations.py vendored

@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
#!/usr/bin/env python3
import argparse
import glob
import os
import shutil
import sys
from typing import List
def isNotStub(path: str) -> bool:
return (os.path.getsize(path) >= (10 * 1024))
def main() -> int:
parser = argparse.ArgumentParser(description='Gather valid Qt translations for NSIS packaging.')
parser.add_argument("qt_translations_folder", help="Qt's translations folder")
parser.add_argument("nsis_packaging_folder", help="NSIS packaging translations folder")
args = parser.parse_args()
tmp_translations: List[str] = glob.glob(f'{args.qt_translations_folder}/qt_??.qm')
tmp_translations += glob.glob(f'{args.qt_translations_folder}/qt_??_??.qm')
tmp_translations += glob.glob(f'{args.qt_translations_folder}/qtbase_??.qm')
tmp_translations += glob.glob(f'{args.qt_translations_folder}qtbase_??_??.qm')
filtered = filter(isNotStub, tmp_translations)
for file in filtered:
shutil.copy2(file, args.nsis_packaging_folder)
return 0
if __name__ == '__main__':
sys.exit(main())
Loading…
Cancel
Save