Add docstrings and help info for the i18n tools in setup.py

This commit is contained in:
Veronica K. B. Olsen
2021-02-15 00:03:14 +01:00
parent c0acc1d087
commit af6d96843d
2 changed files with 18 additions and 0 deletions
+14
View File
@@ -186,14 +186,26 @@ def buildQtDocs():
return return
##
# Qt Linguist QM Builder (qtlrelease)
##
def buildQtI18n(): def buildQtI18n():
"""Build the lang.qm files for Qt Linguist.
"""
try: try:
subprocess.call(["lrelease", "-verbose", "novelWriter.pro"]) subprocess.call(["lrelease", "-verbose", "novelWriter.pro"])
except Exception as e: except Exception as e:
print("QtI18n Release Error:") print("QtI18n Release Error:")
print(str(e)) print(str(e))
##
# Qt Linguist TS Builder (qtlupdate)
##
def buildQtI18nTS(): def buildQtI18nTS():
"""Build the lang.ts files for Qt Linguist.
"""
try: try:
subprocess.call(["pylupdate5", "-verbose", "-noobsolete", "novelWriter.pro"]) subprocess.call(["pylupdate5", "-verbose", "-noobsolete", "novelWriter.pro"])
except Exception as e: except Exception as e:
@@ -863,6 +875,8 @@ if __name__ == "__main__":
"\n" "\n"
" qthelp Build the help documentation for use with the Qt Assistant. Run before\n" " qthelp Build the help documentation for use with the Qt Assistant. Run before\n"
" install to have local help enable in the the installed version.\n" " install to have local help enable in the the installed version.\n"
" qtlupdate Update the translation files for internationalisation.\n"
" qtlrelease Build the language files for internationalisation.\n"
" sample Build the sample project as a zip file. Run before install to enable\n" " sample Build the sample project as a zip file. Run before install to enable\n"
" creating sample projects in the in-app New Project Wizard.\n" " creating sample projects in the in-app New Project Wizard.\n"
"\n" "\n"
+4
View File
@@ -25,6 +25,10 @@ To target the command, add one of `--target-linux`, `--target-darwin` or
`qthelp` Build the help documentation for use with the Qt Assistant. Run `qthelp` Build the help documentation for use with the Qt Assistant. Run
before install to have local help enable in the the installed version before install to have local help enable in the the installed version
`qtlupdate` Update the translation files for internationalisation.
`qtlrelease` Build the language files for internationalisation.
`sample` Build the sample project as a zip file. Run before install to enable `sample` Build the sample project as a zip file. Run before install to enable
creating sample projects in the in-app New Project Wizard. creating sample projects in the in-app New Project Wizard.