Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update translations. #8

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,13 +685,13 @@ def _update_next_button(self):

name: str = self.ui.nextBtn.text()
if isinstance(widget, WizardInstallerSelectPage):
name = self._tr("Next")
name = self.tr("Next")
elif isinstance(widget, WizardInstallerRequiresVersionPage):
name = self._tr("Install anyway")
name = self.tr("Install anyway")
elif isinstance(widget, (WizardInstallerCancelPage, WizardInstallerErrorPage)):
self.ui.nextBtn.setDisabled(True)
else:
name = self._tr("Install")
name = self.tr("Install")

self.ui.nextBtn.setText(name)

Expand Down Expand Up @@ -748,5 +748,5 @@ def exec(self):
self._update_focus()
return super().exec()

def _tr(self, value: str):
def tr(self, value: str): # pyright: ignore[reportIncompatibleMethodOverride]
return QApplication.translate("WizardInstallerDialog", value)
6 changes: 3 additions & 3 deletions src/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ def name(self):
return "BAIN Wizard Installer"

def localizedName(self) -> str:
return self._tr("BAIN Wizard Installer")
return self.tr("BAIN Wizard Installer")

def author(self):
return "Holt59"

def description(self):
return self._tr("Installer for BAIN archive containing wizard scripts.")
return self.tr("Installer for BAIN archive containing wizard scripts.")

def version(self):
return mobase.VersionInfo(1, 0, 2)
Expand Down Expand Up @@ -392,7 +392,7 @@ def install(
else:
return mobase.InstallResult.CANCELED

def _tr(self, value: str) -> str:
def tr(self, value: str) -> str:
# we need this to translate string in Python. Check the common documentation
# for more details
return QApplication.translate("WizardInstaller", value)
34 changes: 29 additions & 5 deletions src/installer_wizard_en.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>WizardInstaller</name>
<message>
<location filename="installer.py" line="52" />
<source>BAIN Wizard Installer</source>
<translation type="unfinished" />
</message>
<message>
<location filename="installer.py" line="58" />
<source>Installer for BAIN archive containing wizard scripts.</source>
<translation type="unfinished" />
</message>
</context>
<context>
<name>WizardInstallerComplete</name>
<message>
Expand Down Expand Up @@ -31,6 +44,22 @@
</context>
<context>
<name>WizardInstallerDialog</name>
<message>
<location filename="ui\wizardinstallerdialog.ui" line="0" />
<location filename="dialog.py" line="688" />
<source>Next</source>
<translation type="unfinished" />
</message>
<message>
<location filename="dialog.py" line="690" />
<source>Install anyway</source>
<translation type="unfinished" />
</message>
<message>
<location filename="dialog.py" line="694" />
<source>Install</source>
<translation type="unfinished" />
</message>
<message>
<location filename="ui\wizardinstallerdialog.ui" line="0" />
<source>BAIN Wizard Installer</source>
Expand All @@ -56,11 +85,6 @@
<source>Back</source>
<translation type="unfinished" />
</message>
<message>
<location filename="ui\wizardinstallerdialog.ui" line="0" />
<source>Next</source>
<translation type="unfinished" />
</message>
<message>
<location filename="ui\wizardinstallerdialog.ui" line="0" />
<source>Cancel</source>
Expand Down
Loading