Skip to content

Commit

Permalink
Update translations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jul 21, 2024
1 parent f1b92a0 commit 8cfcc73
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
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):
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

0 comments on commit 8cfcc73

Please sign in to comment.