Made more strings translatable, including error messages

This commit is contained in:
Campbell 2024-07-03 07:42:36 +10:00
parent dc82790aef
commit 47904c72be
Signed by: NinjaCheetah
GPG Key ID: 670C282B3291D63D
6 changed files with 353 additions and 52 deletions

View File

@ -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):

View File

@ -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"
]
}

Binary file not shown.

View File

@ -4,106 +4,106 @@
<context>
<name>MainWindow</name>
<message>
<location filename="qt/ui/MainMenu.ui" line="26"/>
<location filename="../../qt/ui/MainMenu.ui" line="26"/>
<source>MainWindow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="41"/>
<location filename="../../qt/ui/MainMenu.ui" line="41"/>
<source>Available Titles</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="70"/>
<location filename="../../qt/ui/MainMenu.ui" line="70"/>
<source>Wii</source>
<translatorcomment>Does not change.</translatorcomment>
<translation>Wii</translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="101"/>
<location filename="../../qt/ui/MainMenu.ui" line="101"/>
<source>vWii</source>
<translatorcomment>Does not change.</translatorcomment>
<translation>vWii</translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="132"/>
<location filename="../../qt/ui/MainMenu.ui" line="132"/>
<source>DSi</source>
<translatorcomment>Does not change.</translatorcomment>
<translation>DSi</translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="172"/>
<location filename="../../qt/ui/MainMenu.ui" line="172"/>
<source>Title ID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="179"/>
<location filename="../../qt/ui/MainMenu.ui" line="179"/>
<source>v</source>
<translatorcomment>Does not change.</translatorcomment>
<translation>v</translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="192"/>
<location filename="../../qt/ui/MainMenu.ui" line="192"/>
<source>Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="199"/>
<location filename="../../qt/ui/MainMenu.ui" line="199"/>
<source>Console:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="227"/>
<location filename="../../qt/ui/MainMenu.ui" line="227"/>
<source>Start Download</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="244"/>
<location filename="../../qt/ui/MainMenu.ui" line="244"/>
<source>General Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="251"/>
<location filename="../../qt/ui/MainMenu.ui" line="251"/>
<source>Pack installable archive (WAD/TAD)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="261"/>
<location filename="../../qt/ui/MainMenu.ui" line="261"/>
<source>File Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="268"/>
<location filename="../../qt/ui/MainMenu.ui" line="268"/>
<source>Keep encrypted contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="278"/>
<location filename="../../qt/ui/MainMenu.ui" line="278"/>
<source>Create decrypted contents (*.app)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="288"/>
<location filename="../../qt/ui/MainMenu.ui" line="288"/>
<source>Use local files, if they exist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="295"/>
<location filename="../../qt/ui/MainMenu.ui" line="295"/>
<source>Use the Wii U NUS (faster, only effects Wii/vWii)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="328"/>
<location filename="../../qt/ui/MainMenu.ui" line="328"/>
<source>vWii Title Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="338"/>
<location filename="../../qt/ui/MainMenu.ui" line="338"/>
<source>Re-encrypt title using the Wii Common Key</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qt/ui/MainMenu.ui" line="374"/>
<location filename="../../qt/ui/MainMenu.ui" line="374"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
@ -111,5 +111,94 @@ p, li { white-space: pre-wrap; }
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="81"/>
<source>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 &quot;NUSGet&quot; inside your downloads folder.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="237"/>
<source>Invalid Title ID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="238"/>
<source>The Title ID you have entered is not in a valid format!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="240"/>
<source>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.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="242"/>
<source>Title ID/Version Not Found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="243"/>
<source>No title with the provided Title ID or version could be found!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="246"/>
<source>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.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="248"/>
<source>Content Decryption Failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="249"/>
<source>Content decryption was not successful! Decrypted contents could not be created.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="252"/>
<source>Your TMD or Ticket may be damaged, or they may not correspond with the content being decrypted. If you have checked &quot;Use local files, if they exist&quot;, try disabling that option before trying the download again to fix potential issues with local data.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="255"/>
<source>Ticket Not Available</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="256"/>
<source>No Ticket is Available for the Requested Title!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="259"/>
<source>A ticket could not be downloaded for the requested title, but you have selected &quot;Pack installable archive&quot; or &quot;Create decrypted contents&quot;. These options are not available for titles without a ticket. Only encrypted contents have been saved.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="261"/>
<source>Unknown Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="262"/>
<source>An Unknown Error has Occurred!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="264"/>
<source>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.</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@ -0,0 +1,200 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="nb_NO">
<context>
<name>MainWindow</name>
<message>
<location filename="../../NUSGet.py" line="81"/>
<source>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 &quot;NUSGet&quot; inside your downloads folder.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="237"/>
<source>Invalid Title ID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="238"/>
<source>The Title ID you have entered is not in a valid format!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="240"/>
<source>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.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="242"/>
<source>Title ID/Version Not Found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="243"/>
<source>No title with the provided Title ID or version could be found!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="246"/>
<source>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.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="248"/>
<source>Content Decryption Failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="249"/>
<source>Content decryption was not successful! Decrypted contents could not be created.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="252"/>
<source>Your TMD or Ticket may be damaged, or they may not correspond with the content being decrypted. If you have checked &quot;Use local files, if they exist&quot;, try disabling that option before trying the download again to fix potential issues with local data.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="255"/>
<source>Ticket Not Available</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="256"/>
<source>No Ticket is Available for the Requested Title!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="259"/>
<source>A ticket could not be downloaded for the requested title, but you have selected &quot;Pack installable archive&quot; or &quot;Create decrypted contents&quot;. These options are not available for titles without a ticket. Only encrypted contents have been saved.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="261"/>
<source>Unknown Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="262"/>
<source>An Unknown Error has Occurred!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../NUSGet.py" line="264"/>
<source>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.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="26"/>
<source>MainWindow</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="41"/>
<source>Available Titles</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="70"/>
<source>Wii</source>
<translation>Wii</translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="101"/>
<source>vWii</source>
<translation>vWii</translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="132"/>
<source>DSi</source>
<translation>DSi</translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="172"/>
<source>Title ID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="179"/>
<source>v</source>
<translation>v</translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="192"/>
<source>Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="199"/>
<source>Console:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="227"/>
<source>Start Download</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="244"/>
<source>General Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="251"/>
<source>Pack installable archive (WAD/TAD)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="261"/>
<source>File Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="268"/>
<source>Keep encrypted contents</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="278"/>
<source>Create decrypted contents (*.app)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="288"/>
<source>Use local files, if they exist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="295"/>
<source>Use the Wii U NUS (faster, only effects Wii/vWii)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="328"/>
<source>vWii Title Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="338"/>
<source>Re-encrypt title using the Wii Common Key</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../qt/ui/MainMenu.ui" line="374"/>
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;Sans Serif&apos;; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>