From dc82790aef506b59f9ee07c1aa69311fbe972183 Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Wed, 3 Jul 2024 07:11:25 +1000 Subject: [PATCH] Add base for translating the NUSGet interface via Qt Linguist --- NUSGet.py | 11 ++- NUSGet.pyproject | 3 + resources/translations/nusget_es.qm | Bin 0 -> 315 bytes resources/translations/nusget_es.ts | 115 ++++++++++++++++++++++++++++ 4 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 NUSGet.pyproject create mode 100644 resources/translations/nusget_es.qm create mode 100644 resources/translations/nusget_es.ts diff --git a/NUSGet.py b/NUSGet.py index f5017be..9f39eac 100644 --- a/NUSGet.py +++ b/NUSGet.py @@ -14,7 +14,7 @@ from PySide6.QtGui import QIcon from PySide6.QtWidgets import (QApplication, QMainWindow, QMessageBox, QTreeWidgetItem, QHeaderView, QStyle, QStyleFactory) -from PySide6.QtCore import QRunnable, Slot, QThreadPool, Signal, QObject +from PySide6.QtCore import QRunnable, Slot, QThreadPool, Signal, QObject, QLibraryInfo, QTranslator, QLocale from qt.py.ui_MainMenu import Ui_MainWindow @@ -606,6 +606,15 @@ if __name__ == "__main__": elif "kvantum" in QStyleFactory.keys(): app.setStyle("kvantum") + path = QLibraryInfo.path(QLibraryInfo.LibraryPath.TranslationsPath) + translator = QTranslator(app) + if translator.load(QLocale.system(), 'qtbase', '_', path): + app.installTranslator(translator) + translator = QTranslator(app) + path = 'resources/translations' + if translator.load(QLocale.system(), 'nusget', '_', path): + app.installTranslator(translator) + window = MainWindow() window.setWindowTitle("NUSGet") window.setWindowIcon(QIcon(os.path.join(os.path.dirname(__file__), "resources/icon.png"))) diff --git a/NUSGet.pyproject b/NUSGet.pyproject new file mode 100644 index 0000000..d23a2f6 --- /dev/null +++ b/NUSGet.pyproject @@ -0,0 +1,3 @@ +{ + "files": ["NUSGet.py", "./qt/py/ui_MainMenu.py", "resources/translations/nusget_es.ts"] +} diff --git a/resources/translations/nusget_es.qm b/resources/translations/nusget_es.qm new file mode 100644 index 0000000000000000000000000000000000000000..aaee3cdb1b56c12d2a89fb63e6567c53442976a4 GIT binary patch literal 315 zcmcE7ks@*G{hX<16=n7(EZlo{IRgU&Yie=4Yp@fLr2)icKs=j)!E+{%_GVy+{RyOt z8QAxN=)J6y&lm$~hD;!S!3-p17=jrJ7!n!sfI`I#84L;xAwX6MLk>eKLoo+PDH{+A zIF==5<|HQNq$-4DmgJ-svjYXWd=oSC!ZY(y^2-@PMzJxt01eB8Yhrc@&cv=R9B2iS jy6{Y_>X;bH;ASzFVKa#X=vh>=Sjw;%)&X=J6C)!4_<}xz literal 0 HcmV?d00001 diff --git a/resources/translations/nusget_es.ts b/resources/translations/nusget_es.ts new file mode 100644 index 0000000..cad5091 --- /dev/null +++ b/resources/translations/nusget_es.ts @@ -0,0 +1,115 @@ + + + + + MainWindow + + + MainWindow + + + + + Available Titles + + + + + Wii + Does not change. + Wii + + + + vWii + Does not change. + vWii + + + + DSi + Does not change. + DSi + + + + Title ID + + + + + v + Does not change. + v + + + + Version + + + + + Console: + + + + + Start Download + + + + + General Settings + + + + + Pack installable archive (WAD/TAD) + + + + + File Name + + + + + Keep encrypted contents + + + + + Create decrypted contents (*.app) + + + + + Use local files, if they exist + + + + + Use the Wii U NUS (faster, only effects Wii/vWii) + + + + + vWii Title Settings + + + + + Re-encrypt title using the Wii Common Key + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> + + + +