From 47904c72be4ddba3bf5dab7f731a1ec181320bbd Mon Sep 17 00:00:00 2001
From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com>
Date: Wed, 3 Jul 2024 07:42:36 +1000
Subject: [PATCH] Made more strings translatable, including error messages
---
NUSGet.py | 69 +++++-----
NUSGet.pyproject | 7 +-
resources/translations/nusget_es.qm | Bin 315 -> 232 bytes
resources/translations/nusget_es.ts | 129 +++++++++++++++---
resources/translations/nusget_no.qm | Bin 0 -> 232 bytes
resources/translations/nusget_no.ts | 200 ++++++++++++++++++++++++++++
6 files changed, 353 insertions(+), 52 deletions(-)
create mode 100644 resources/translations/nusget_no.qm
create mode 100644 resources/translations/nusget_no.ts
diff --git a/NUSGet.py b/NUSGet.py
index 9f39eac..5f7efc4 100644
--- a/NUSGet.py
+++ b/NUSGet.py
@@ -18,6 +18,7 @@ from PySide6.QtCore import QRunnable, Slot, QThreadPool, Signal, QObject, QLibra
from qt.py.ui_MainMenu import Ui_MainWindow
+nusget_version = "1.1"
regions = {"World": ["41"], "USA/NTSC": ["45"], "Europe/PAL": ["50"], "Japan": ["4A"], "Korea": ["4B"], "China": ["43"],
"Australia/NZ": ["55"]}
@@ -70,13 +71,14 @@ class MainWindow(QMainWindow, Ui_MainWindow):
# Basic intro text set to automatically show when the app loads. This may be changed in the future.
libwiipy_version = "v" + version("libWiiPy")
libtwlpy_version = "v" + version("libTWLPy")
- self.ui.log_text_browser.setText(f"NUSGet v1.0\nDeveloped by NinjaCheetah\nPowered by libWiiPy "
- f"{libwiipy_version}\nDSi support provided by libTWLPy {libtwlpy_version}\n\n"
- f"Select a title from the list on the left, or enter a Title ID to begin.\n\n"
- f"Titles marked with a checkmark are free and have a ticket available, and can"
- f" be decrypted and/or packed into a WAD or TAD. Titles with an X do not have "
- f"a ticket, and only their encrypted contents can be saved.\n\nTitles will be "
- f"downloaded to a folder named \"NUSGet\" inside your downloads folder.")
+ log_message = self.tr(f"NUSGet v{nusget_version}\nDeveloped by NinjaCheetah\nPowered by libWiiPy "
+ f"{libwiipy_version}\nDSi support provided by libTWLPy {libtwlpy_version}\n\n"
+ f"Select a title from the list on the left, or enter a Title ID to begin.\n\n"
+ f"Titles marked with a checkmark are free and have a ticket available, and can"
+ f" be decrypted and/or packed into a WAD or TAD. Titles with an X do not have "
+ f"a ticket, and only their encrypted contents can be saved.\n\nTitles will be "
+ f"downloaded to a folder named \"NUSGet\" inside your downloads folder.")
+ self.ui.log_text_browser.setText(log_message)
# Add console entries to dropdown and attach on change signal.
self.ui.console_select_dropdown.addItem("Wii")
self.ui.console_select_dropdown.addItem("vWii")
@@ -231,34 +233,38 @@ class MainWindow(QMainWindow, Ui_MainWindow):
msg_box.setStandardButtons(QMessageBox.StandardButton.Ok)
msg_box.setDefaultButton(QMessageBox.StandardButton.Ok)
if result == -1:
- msg_box.setWindowTitle("Invalid Title ID")
- msg_box.setText("The Title ID you have entered is not in a valid format!")
- msg_box.setInformativeText("Title IDs must be 16 digit strings of numbers and letters. Please enter a "
- "correctly formatted Title ID, or select one from the menu on the left.")
- msg_box.exec()
+ window_title = self.tr("Invalid Title ID")
+ title_text = self.tr("The Title ID you have entered is not in a valid format!")
+ body_text = self.tr("Title IDs must be 16 digit strings of numbers and letters. Please enter a correctly "
+ "formatted Title ID, or select one from the menu on the left.")
elif result == -2:
- msg_box.setWindowTitle("Title ID/Version Not Found")
- msg_box.setText("No title with the provided Title ID or version could be found!")
- msg_box.setInformativeText("Please make sure that you have entered a valid Title ID, or selected one from "
- " the title database, and that the provided version exists for the title you are"
- " attempting to download.")
- msg_box.exec()
+ window_title = self.tr("Title ID/Version Not Found")
+ title_text = self.tr("No title with the provided Title ID or version could be found!")
+ body_text = self.tr("Please make sure that you have entered a valid Title ID, or selected one from the "
+ "title database, and that the provided version exists for the title you are attempting "
+ "to download.")
elif result == -3:
- msg_box.setWindowTitle("Content Decryption Failed")
- msg_box.setText("Content decryption was not successful! Decrypted contents could not be created.")
- msg_box.setInformativeText("Your TMD or Ticket may be damaged, or they may not correspond with the content "
- "being decrypted. If you have checked \"Use local files, if they exist\", try "
- "disabling that option before trying the download again to fix potential issues "
- "with local data.")
- msg_box.exec()
+ window_title = self.tr("Content Decryption Failed")
+ title_text = self.tr("Content decryption was not successful! Decrypted contents could not be created.")
+ body_text = self.tr("Your TMD or Ticket may be damaged, or they may not correspond with the content being "
+ "decrypted. If you have checked \"Use local files, if they exist\", try disabling that "
+ "option before trying the download again to fix potential issues with local data.")
elif result == 1:
msg_box.setIcon(QMessageBox.Icon.Warning)
- msg_box.setWindowTitle("Ticket Not Available")
- msg_box.setText("No Ticket is Available for the Requested Title!")
- msg_box.setInformativeText(
- "A ticket could not be downloaded for the requested title, but you have selected \"Pack installable "
- " archive\" or \"Create decrypted contents\". These options are not available for titles without a "
- " ticket. Only encrypted contents have been saved.")
+ window_title = self.tr("Ticket Not Available")
+ title_text = self.tr("No Ticket is Available for the Requested Title!")
+ body_text = self.tr("A ticket could not be downloaded for the requested title, but you have selected \"Pack"
+ " installable archive\" or \"Create decrypted contents\". These options are not "
+ "available for titles without a ticket. Only encrypted contents have been saved.")
+ else:
+ window_title = self.tr("Unknown Error")
+ title_text = self.tr("An Unknown Error has Occurred!")
+ body_text = self.tr("Please try again. If this issue persists, please open a new issue on GitHub detailing"
+ " what you were trying to do when this error occurred.")
+ if result != 0:
+ msg_box.setWindowTitle(window_title)
+ msg_box.setText(title_text)
+ msg_box.setInformativeText(body_text)
msg_box.exec()
# Now that the thread has closed, unlock the UI to allow for the next download.
self.ui.tid_entry.setEnabled(True)
@@ -606,6 +612,7 @@ if __name__ == "__main__":
elif "kvantum" in QStyleFactory.keys():
app.setStyle("kvantum")
+ # Load qtbase translations, and then apps-specific translations.
path = QLibraryInfo.path(QLibraryInfo.LibraryPath.TranslationsPath)
translator = QTranslator(app)
if translator.load(QLocale.system(), 'qtbase', '_', path):
diff --git a/NUSGet.pyproject b/NUSGet.pyproject
index d23a2f6..7d69181 100644
--- a/NUSGet.pyproject
+++ b/NUSGet.pyproject
@@ -1,3 +1,8 @@
{
- "files": ["NUSGet.py", "./qt/py/ui_MainMenu.py", "resources/translations/nusget_es.ts"]
+ "files": [
+ "NUSGet.py",
+ "./qt/py/ui_MainMenu.py",
+ "./resources/translations/nusget_es.ts",
+ "./resources/translations/nusget_no.ts"
+ ]
}
diff --git a/resources/translations/nusget_es.qm b/resources/translations/nusget_es.qm
index aaee3cdb1b56c12d2a89fb63e6567c53442976a4..586a43b90727ea5687ab01515742cc4dff7d0e53 100644
GIT binary patch
delta 48
ucmdnZ^n!7MoSFgy149`Q2QV;r&IHmx5c?BIXfUwv1<^&BKw|F1=}Q3boC?AK
delta 137
zcmaFCxSMH$T)hSZ149`Q&t_oooC&1885m-J0_kD~_Pro_FYDwp#z2}O6Nq0h0|^<1
zV1@#QM20+|P%%RWg91YckX6Ev!;s2Q%mGr$2E+o6Wr>+NiAg!B3L%*#IjP0$KtV3w
W#LT?#%)FHRaz>C*Yzz~<<^cfTyB)Lu
diff --git a/resources/translations/nusget_es.ts b/resources/translations/nusget_es.ts
index cad5091..f3fdbf9 100644
--- a/resources/translations/nusget_es.ts
+++ b/resources/translations/nusget_es.ts
@@ -4,106 +4,106 @@
MainWindow
-
+ MainWindow
-
+ Available Titles
-
+ WiiDoes not change.Wii
-
+ vWiiDoes not change.vWii
-
+ DSiDoes not change.DSi
-
+ Title ID
-
+ vDoes 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; }
@@ -111,5 +111,94 @@ p, li { white-space: pre-wrap; }
<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>
+
+
+ NUSGet v{nusget_version}
+Developed by NinjaCheetah
+Powered by libWiiPy {libwiipy_version}
+DSi support provided by libTWLPy {libtwlpy_version}
+
+Select a title from the list on the left, or enter a Title ID to begin.
+
+Titles marked with a checkmark are free and have a ticket available, and can be decrypted and/or packed into a WAD or TAD. Titles with an X do not have a ticket, and only their encrypted contents can be saved.
+
+Titles will be downloaded to a folder named "NUSGet" inside your downloads folder.
+
+
+
+
+ Invalid Title ID
+
+
+
+
+ The Title ID you have entered is not in a valid format!
+
+
+
+
+ Title IDs must be 16 digit strings of numbers and letters. Please enter a correctly formatted Title ID, or select one from the menu on the left.
+
+
+
+
+ Title ID/Version Not Found
+
+
+
+
+ No title with the provided Title ID or version could be found!
+
+
+
+
+ Please make sure that you have entered a valid Title ID, or selected one from the title database, and that the provided version exists for the title you are attempting to download.
+
+
+
+
+ Content Decryption Failed
+
+
+
+
+ Content decryption was not successful! Decrypted contents could not be created.
+
+
+
+
+ Your TMD or Ticket may be damaged, or they may not correspond with the content being decrypted. If you have checked "Use local files, if they exist", try disabling that option before trying the download again to fix potential issues with local data.
+
+
+
+
+ Ticket Not Available
+
+
+
+
+ No Ticket is Available for the Requested Title!
+
+
+
+
+ A ticket could not be downloaded for the requested title, but you have selected "Pack installable archive" or "Create decrypted contents". These options are not available for titles without a ticket. Only encrypted contents have been saved.
+
+
+
+
+ Unknown Error
+
+
+
+
+ An Unknown Error has Occurred!
+
+
+
+
+ Please try again. If this issue persists, please open a new issue on GitHub detailing what you were trying to do when this error occurred.
+
+
diff --git a/resources/translations/nusget_no.qm b/resources/translations/nusget_no.qm
new file mode 100644
index 0000000000000000000000000000000000000000..c274ed4d5b049200112e07d6e9da35948b8f79ef
GIT binary patch
literal 232
zcmcE7ks@*G{hX<16=n7(EZlo{IRgU&YhF^kpT853r2xcbKpeop;5idW13~OhAfds)
zz86FnWde!0%s_&T!G$51A(I2h1hN?zm|cQ1*?}~dZ(?R%cxGNoemNsVT{uG~vbyk0
gtm>E;%HU=(mSHoA1L!hTvslWo7}f!F1QR1801c@tod5s;
literal 0
HcmV?d00001
diff --git a/resources/translations/nusget_no.ts b/resources/translations/nusget_no.ts
new file mode 100644
index 0000000..f9a50e1
--- /dev/null
+++ b/resources/translations/nusget_no.ts
@@ -0,0 +1,200 @@
+
+
+
+
+ MainWindow
+
+
+ NUSGet v{nusget_version}
+Developed by NinjaCheetah
+Powered by libWiiPy {libwiipy_version}
+DSi support provided by libTWLPy {libtwlpy_version}
+
+Select a title from the list on the left, or enter a Title ID to begin.
+
+Titles marked with a checkmark are free and have a ticket available, and can be decrypted and/or packed into a WAD or TAD. Titles with an X do not have a ticket, and only their encrypted contents can be saved.
+
+Titles will be downloaded to a folder named "NUSGet" inside your downloads folder.
+
+
+
+
+ Invalid Title ID
+
+
+
+
+ The Title ID you have entered is not in a valid format!
+
+
+
+
+ Title IDs must be 16 digit strings of numbers and letters. Please enter a correctly formatted Title ID, or select one from the menu on the left.
+
+
+
+
+ Title ID/Version Not Found
+
+
+
+
+ No title with the provided Title ID or version could be found!
+
+
+
+
+ Please make sure that you have entered a valid Title ID, or selected one from the title database, and that the provided version exists for the title you are attempting to download.
+
+
+
+
+ Content Decryption Failed
+
+
+
+
+ Content decryption was not successful! Decrypted contents could not be created.
+
+
+
+
+ Your TMD or Ticket may be damaged, or they may not correspond with the content being decrypted. If you have checked "Use local files, if they exist", try disabling that option before trying the download again to fix potential issues with local data.
+
+
+
+
+ Ticket Not Available
+
+
+
+
+ No Ticket is Available for the Requested Title!
+
+
+
+
+ A ticket could not be downloaded for the requested title, but you have selected "Pack installable archive" or "Create decrypted contents". These options are not available for titles without a ticket. Only encrypted contents have been saved.
+
+
+
+
+ Unknown Error
+
+
+
+
+ An Unknown Error has Occurred!
+
+
+
+
+ Please try again. If this issue persists, please open a new issue on GitHub detailing what you were trying to do when this error occurred.
+
+
+
+
+ MainWindow
+
+
+
+
+ Available Titles
+
+
+
+
+ Wii
+ Wii
+
+
+
+ vWii
+ vWii
+
+
+
+ DSi
+ DSi
+
+
+
+ Title ID
+
+
+
+
+ v
+ 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>
+
+
+
+