Skip to content

Commit f4e1168

Browse files
committed
Update translations.
1 parent f1b92a0 commit f4e1168

File tree

3 files changed

+36
-18
lines changed

3 files changed

+36
-18
lines changed

src/dialog.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -685,13 +685,13 @@ def _update_next_button(self):
685685

686686
name: str = self.ui.nextBtn.text()
687687
if isinstance(widget, WizardInstallerSelectPage):
688-
name = self._tr("Next")
688+
name = QApplication.translate("WizardInstallerDialog", "Next")
689689
elif isinstance(widget, WizardInstallerRequiresVersionPage):
690-
name = self._tr("Install anyway")
690+
name = QApplication.translate("WizardInstallerDialog", "Install anyway")
691691
elif isinstance(widget, (WizardInstallerCancelPage, WizardInstallerErrorPage)):
692692
self.ui.nextBtn.setDisabled(True)
693693
else:
694-
name = self._tr("Install")
694+
name = QApplication.translate("WizardInstallerDialog", "Install")
695695

696696
self.ui.nextBtn.setText(name)
697697

@@ -747,6 +747,3 @@ def exec(self):
747747
self._update_next_button()
748748
self._update_focus()
749749
return super().exec()
750-
751-
def _tr(self, value: str):
752-
return QApplication.translate("WizardInstallerDialog", value)

src/installer.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,15 @@ def name(self):
4949
return "BAIN Wizard Installer"
5050

5151
def localizedName(self) -> str:
52-
return self._tr("BAIN Wizard Installer")
52+
return QApplication.translate("WizardInstaller", "BAIN Wizard Installer")
5353

5454
def author(self):
5555
return "Holt59"
5656

5757
def description(self):
58-
return self._tr("Installer for BAIN archive containing wizard scripts.")
58+
return QApplication.translate(
59+
"WizardInstaller", "Installer for BAIN archive containing wizard scripts."
60+
)
5961

6062
def version(self):
6163
return mobase.VersionInfo(1, 0, 2)
@@ -391,8 +393,3 @@ def install(
391393
# if user canceled, we simply notify the installation manager
392394
else:
393395
return mobase.InstallResult.CANCELED
394-
395-
def _tr(self, value: str) -> str:
396-
# we need this to translate string in Python. Check the common documentation
397-
# for more details
398-
return QApplication.translate("WizardInstaller", value)

src/installer_wizard_en.ts

+29-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!DOCTYPE TS>
33
<TS version="2.1">
4+
<context>
5+
<name>WizardInstaller</name>
6+
<message>
7+
<location filename="installer.py" line="52" />
8+
<source>BAIN Wizard Installer</source>
9+
<translation type="unfinished" />
10+
</message>
11+
<message>
12+
<location filename="installer.py" line="58" />
13+
<source>Installer for BAIN archive containing wizard scripts.</source>
14+
<translation type="unfinished" />
15+
</message>
16+
</context>
417
<context>
518
<name>WizardInstallerComplete</name>
619
<message>
@@ -31,6 +44,22 @@
3144
</context>
3245
<context>
3346
<name>WizardInstallerDialog</name>
47+
<message>
48+
<location filename="ui\wizardinstallerdialog.ui" line="0" />
49+
<location filename="dialog.py" line="688" />
50+
<source>Next</source>
51+
<translation type="unfinished" />
52+
</message>
53+
<message>
54+
<location filename="dialog.py" line="690" />
55+
<source>Install anyway</source>
56+
<translation type="unfinished" />
57+
</message>
58+
<message>
59+
<location filename="dialog.py" line="694" />
60+
<source>Install</source>
61+
<translation type="unfinished" />
62+
</message>
3463
<message>
3564
<location filename="ui\wizardinstallerdialog.ui" line="0" />
3665
<source>BAIN Wizard Installer</source>
@@ -56,11 +85,6 @@
5685
<source>Back</source>
5786
<translation type="unfinished" />
5887
</message>
59-
<message>
60-
<location filename="ui\wizardinstallerdialog.ui" line="0" />
61-
<source>Next</source>
62-
<translation type="unfinished" />
63-
</message>
6488
<message>
6589
<location filename="ui\wizardinstallerdialog.ui" line="0" />
6690
<source>Cancel</source>

0 commit comments

Comments
 (0)