1
0
Fork 0
mirror of synced 2024-06-02 10:44:40 +12:00

Languages (de)

This commit is contained in:
Dummerle 2021-02-28 20:01:15 +01:00
parent 09bd07cdb2
commit 323d23c6ad
13 changed files with 51 additions and 114 deletions

View file

@ -11,25 +11,25 @@ class MiniWidget(QWidget):
self.layout = QVBoxLayout()
self.core = core
self.layout.addWidget(QLabel("Account"))
self.layout.addWidget(QLabel("Logged in as " + str(self.core.lgd.userdata.get("display_name"))))
self.layout.addWidget(QLabel(self.tr("Logged in as ") + str(self.core.lgd.userdata.get("display_name"))))
self.open_browser = QPushButton("Account settings")
self.open_browser = QPushButton(self.tr("Account settings"))
self.open_browser.clicked.connect(self.open_account)
self.layout.addWidget(self.open_browser)
self.logout_button = QPushButton("Logout")
self.logout_button = QPushButton(self.tr("Logout"))
self.logout_button.clicked.connect(self.logout)
self.layout.addWidget(self.logout_button)
self.setLayout(self.layout)
def logout(self):
reply = QMessageBox.question(self.parent().parent(), 'Message',
"Do you really want to logout", QMessageBox.Yes |
self.tr("Do you really want to logout"), QMessageBox.Yes |
QMessageBox.No, QMessageBox.No)
if reply == QMessageBox.Yes:
self.core.lgd.invalidate_userdata()
QCoreApplication.exit(0)
QCoreApplication.exit()
def open_account(self):
webbrowser.open("https://www.epicgames.com/account/personal?productName=epicgames")

View file

@ -100,13 +100,13 @@ class DownloadTab(QWidget):
self.prog_bar = QProgressBar()
self.layout.addWidget(self.prog_bar)
label = QLabel(
"<b>WARNING</b>: The progress bar is not implemented. It is normal, if there is no progress. The "
"progress is visible in console, because Legendary prints output to console. A pull request is active to "
"get output")
self.tr("<b>WARNING</b>: The progress bar is not implemented. It is normal, if there is no progress. The "
"progress is visible in console, because Legendary prints output to console. A pull request is "
"active to get output"))
label.setWordWrap(True)
self.layout.addWidget(label)
self.installing_game_widget = QLabel("No active Download")
self.installing_game_widget = QLabel(self.tr("No active Download"))
self.layout.addWidget(self.installing_game_widget)
self.update_title = QLabel("<h2>Updates</h2>")
@ -117,7 +117,7 @@ class DownloadTab(QWidget):
""")
self.layout.addWidget(self.update_title)
if not updates:
self.update_text = QLabel("No updates available")
self.update_text = QLabel(self.tr("No updates available"))
self.layout.addWidget(self.update_text)
else:
for i in updates:
@ -137,7 +137,7 @@ class DownloadTab(QWidget):
base_path=options["options"]["path"],
max_workers=options["options"]["max_workers"])
if not analysis.dl_size:
QMessageBox.information(self, "Warning", "Download size is 0")
QMessageBox.information(self, "Warning", self.tr("Download size is 0. Game already exists"))
return
# Information
if not InstallInfoDialog(dl_size=analysis.dl_size, install_size=analysis.install_size).get_accept():
@ -155,7 +155,8 @@ class DownloadTab(QWidget):
for msg in sorted(res.failures):
logger.error(msg)
logger.error('Installation cannot proceed, exiting.')
QMessageBox.warning(self, "Installation failed", "Installation failed. See logs for more information")
QMessageBox.warning(self, "Installation failed",
self.tr("Installation failed. See logs for more information"))
return
self.active_game = game
self.thread = DownloadThread(dlm, self.core, igame)
@ -167,12 +168,12 @@ class DownloadTab(QWidget):
pass
elif text == "finish":
notification = Notify()
notification.title = "Installation finished"
notification.message = f"Download of game {self.active_game.app_title}"
notification.title = self.tr("Installation finished")
notification.message = self.tr("Download of game ")+self.active_game.app_title
notification.send()
# QMessageBox.information(self, "Info", "Download finished")
self.finished.emit()
self.installing_game.setText("Installing Game: No running download")
self.installing_game.setText(self.tr("Installing Game: No active download"))
elif text == "error":
QMessageBox.warning(self, "warn", "Download error")
@ -192,8 +193,8 @@ class UpdateWidget(QWidget):
self.title = QLabel(self.game.title)
self.layout.addWidget(self.title)
self.update_button = QPushButton("Update Game")
self.update_button.clicked.connect(lambda :self.update.emit(app_name))
self.update_button = QPushButton(self.tr("Update Game"))
self.update_button.clicked.connect(lambda: self.update.emit(app_name))
self.layout.addWidget(self.update_button)
self.setLayout(self.layout)

View file

@ -32,7 +32,7 @@ class GameWidgetInstalled(QWidget):
self.update_available = self.core.get_asset(self.game.app_name, True).build_version != game.version
if self.update_available:
logger.info("Update available for game: " + self.game.app_name)
self.info_text = "Update available"
self.info_text = self.tr("Update available")
if os.path.exists(f"{self.IMAGE_DIR}/{game.app_name}/FinalArt.png"):
pixmap = QPixmap(f"{self.IMAGE_DIR}/{game.app_name}/FinalArt.png")
@ -96,7 +96,7 @@ class GameWidgetInstalled(QWidget):
logger.error("Could not start process")
return
self.proc.finished.connect(self.finished)
self.info_label.setText("Game running")
self.info_label.setText(self.tr("Game running"))
self.running = True
def finished(self):
@ -105,7 +105,7 @@ class GameWidgetInstalled(QWidget):
def menu_action(self, action: str):
if action == "uninstall":
if QMessageBox.question(self, "Uninstall", f"Do you want to uninstall {self.game.title}",
if QMessageBox.question(self, "Uninstall", self.tr("Do you want to uninstall") + self.game.title,
QMessageBox.Yes | QMessageBox.No) == QMessageBox.Yes:
logger.info("Uninstalling " + self.game.title)
self.core.uninstall_game(self.game)
@ -119,8 +119,8 @@ class Menu(QMenu):
def __init__(self):
super(Menu, self).__init__()
self.addAction("Game info", lambda: self.action.emit("info"))
self.addAction("Uninstall", lambda: self.action.emit("uninstall"))
self.addAction(self.tr("Game info"), lambda: self.action.emit("info"))
self.addAction(self.tr("Uninstall"), lambda: self.action.emit("uninstall"))
def info(self):
pass

View file

@ -57,7 +57,7 @@ class GameWidgetUninstalled(QWidget):
self.install()
def enterEvent(self, QEvent):
self.info_label.setText("Install Game")
self.info_label.setText(self.tr("Install Game"))
def leaveEvent(self, QEvent):
self.info_label.setText("")

View file

@ -49,19 +49,19 @@ class GameListHeadBar(QWidget):
super(GameListHeadBar, self).__init__()
self.layout = QHBoxLayout()
self.installed_only = QCheckBox("Installed only")
self.installed_only = QCheckBox(self.tr("Installed only"))
self.layout.addWidget(self.installed_only)
self.layout.addStretch()
self.search_bar = QLineEdit()
self.search_bar.setPlaceholderText("Search Game")
self.search_bar.setPlaceholderText(self.tr("Search Game"))
self.layout.addWidget(self.search_bar)
self.layout.addStretch()
self.list_view = QLabel("List view")
self.list_view = QLabel(self.tr("List view"))
self.layout.addWidget(self.list_view)
self.view = QCheckBox("Icon view")
self.view = QCheckBox(self.tr("Icon view"))
self.layout.addWidget(self.view)
self.refresh_list = QPushButton()
self.refresh_list.setIcon(self.style().standardIcon(getattr(QStyle, "SP_BrowserReload"))) # Reload icon

View file

@ -9,19 +9,21 @@ class About(QWidget):
self.title = QLabel("<h2>About</h2>")
self.layout.addWidget(self.title)
self.dev = QLabel("Developer: <a href='https://github.com/Dummerle'>Dummerle</a>")
self.dev = QLabel(self.tr("Developer:")+"<a href='https://github.com/Dummerle'>Dummerle</a>")
self.dev.setToolTip("Github")
self.dev.setOpenExternalLinks(True)
self.dev.setWordWrap(True)
self.layout.addWidget(self.dev)
self.lgd_dev = QLabel("Legendary developer: <a href='https://github.com/derrod/'>derrod</a>")
self.lgd_dev = QLabel(self.tr("Legendary developer:")+"<a href='https://github.com/derrod/'>derrod</a>")
self.lgd_dev.setOpenExternalLinks(True)
self.lgd_dev.setToolTip("Github")
self.layout.addWidget(self.lgd_dev)
self.license = QLabel("License: GNU General Public License v3.0")
self.layout.addWidget(self.license)
self.info_text = QLabel(
"This is a beta version, so you can get bugs. If you get a bug, please report it by creating a Issue on <a href='https://github.com/Dummerle/Rare/issues'>Github</a>. You can also contact me on Discord (Dummerle#7419). If you have a feature request, please contact me")
self.tr("This is a beta version, so you can get bugs. If you get a bug, please report it by creating a "
"Issue on <a href='https://github.com/Dummerle/Rare/issues'>Github</a>. You can also contact me "
"on Discord (Dummerle#7419). If you have a feature request, please contact me"))
self.info_text.setWordWrap(True)
self.info_text.setOpenExternalLinks(True)
self.layout.addWidget(self.info_text)

View file

@ -15,7 +15,7 @@ class LegendarySettings(QWidget):
super(LegendarySettings, self).__init__()
self.layout = QVBoxLayout()
self.core = core
self.title = QLabel("<h2>Legendary settings</h2>")
self.title = QLabel("<h2>"+self.tr("Legendary settings")+"</h2>")
self.layout.addWidget(self.title)
# Default installation directory
@ -24,7 +24,7 @@ class LegendarySettings(QWidget):
self.select_path.text_edit.textChanged.connect(lambda t: self.save_path_button.setDisabled(False))
self.save_path_button = QPushButton("Save")
self.save_path_button.clicked.connect(self.save_path)
self.install_dir_widget = SettingsWidget("Default installation directory", self.select_path,
self.install_dir_widget = SettingsWidget(self.tr("Default installation directory"), self.select_path,
self.save_path_button)
self.layout.addWidget(self.install_dir_widget)
@ -33,7 +33,7 @@ class LegendarySettings(QWidget):
self.max_worker_select.setValidator(QIntValidator())
self.max_worker_select.setPlaceholderText("Default")
self.max_worker_select.textChanged.connect(self.max_worker_save)
self.max_worker_widget = SettingsWidget("Max workers for Download (Less: slower download)(0: Default)",
self.max_worker_widget = SettingsWidget(self.tr("Max workers for Download (Less: slower download)(0: Default)"),
self.max_worker_select)
self.layout.addWidget(self.max_worker_widget)

View file

@ -25,7 +25,7 @@ class LinuxSettings(QWidget):
self.select_path.text_edit.textChanged.connect(lambda t: self.save_path_button.setDisabled(False))
self.save_path_button = QPushButton("Save")
self.save_path_button.clicked.connect(self.save_wineprefix)
self.install_dir_widget = SettingsWidget("Default Wine Prefix", self.select_path, self.save_path_button)
self.install_dir_widget = SettingsWidget(self.tr("Default Wine Prefix"), self.select_path, self.save_path_button)
self.layout.addWidget(self.install_dir_widget)
# Wine executable
@ -35,7 +35,7 @@ class LinuxSettings(QWidget):
self.select_wine_exec.text_edit.textChanged.connect(lambda t: self.save_path_button.setDisabled(False))
self.save_wine_exec = QPushButton("Save")
self.save_wine_exec.clicked.connect(self.save_wineexec)
self.install_dir_widget = SettingsWidget("Default Wine executable", self.select_wine_exec, self.save_wine_exec)
self.install_dir_widget = SettingsWidget(self.tr("Default Wine executable"), self.select_wine_exec, self.save_wine_exec)
self.layout.addWidget(self.install_dir_widget)
# dxvk

View file

@ -16,7 +16,7 @@ class RareSettings(QWidget):
def __init__(self):
super(RareSettings, self).__init__()
self.layout = QVBoxLayout()
self.title = QLabel("<h2>Rare settings</h2>")
self.title = QLabel("<h2>"+self.tr("Rare settings")+"</h2>")
self.layout.addWidget(self.title)
settings = QSettings()
img_dir = settings.value("img_dir", type=str)
@ -32,7 +32,7 @@ class RareSettings(QWidget):
self.select_path.text_edit.textChanged.connect(lambda t: self.save_path_button.setDisabled(False))
self.save_path_button = QPushButton("Save")
self.save_path_button.clicked.connect(self.save_path)
self.img_dir = SettingsWidget("Image Directory", self.select_path, self.save_path_button)
self.img_dir = SettingsWidget(self.tr("Image Directory"), self.select_path, self.save_path_button)
self.layout.addWidget(self.img_dir)
# Select lang
@ -65,7 +65,7 @@ class RareSettings(QWidget):
elif i == 1:
settings.setValue("language", "de")
del settings
self.lang_widget.info_text.setText("Restart Application to activate changes")
self.lang_widget.info_text.setText(self.tr("Restart Application to activate changes"))
def update_path(self):
settings = QSettings()

View file

@ -1,6 +1,5 @@
import logging
import os
import sys
from PyQt5.QtCore import QTranslator, QSettings
from PyQt5.QtWidgets import QApplication
@ -20,7 +19,7 @@ core = LegendaryCore()
def main():
app = QApplication(sys.argv)
app = QApplication(["--style", "material"])
app.setApplicationName("Rare")
app.setOrganizationName("Rare")
settings = QSettings()

View file

@ -7,13 +7,21 @@ QLabel {
background-color: transparent;
}
QTabBar{
border-bottom: none;
}
QTabBar::tab#main_tab_bar {
border: none;
border-bottom: none;
padding: 5px;
}
QTabBar::tab:selected{
border-bottom: 2px solid white;
}
QTabBar::tab:hover#main_tab_bar {
background-color: black;
}
QTabBar::tab:disabled {
@ -71,9 +79,7 @@ QPushButton:hover#installed_menu_button {
}
QTabBar::tab#settings_bar {
border-radius: 0;
}
QTabBar::tab:hover#settings_bar {

Binary file not shown.

View file

@ -1,71 +0,0 @@
< ? xml version = "1.0"
encoding = "utf-8" ?
>
<!DOCTYPE
TS >
<TS version = "2.1"
language = "de_DE" >
<context>
<name>LaunchDialog < /name>
< message >
<location filename = "../Components/Launch/LaunchDialog.py"
line = "52" / >
<source>Launching
Rare < /source>
< translation > Starte
Rare < /translation>
< /message>
< message >
<location filename = "../Components/Launch/LaunchDialog.py"
line = "54" / >
<source>Logging in </source>
< translation > Einloggen < /translation>
< /message>
< /context>
< context >
<name>LoginDialog < /name>
< message >
<location filename = "../utils/Dialogs/Login/LoginDialog.py"
line = "32" / >
<source>Select
one
option
to
Login < /source>
< translation > Wähle
eine
Option
zum
einloggen
aus < /translation>
< /message>
< /context>
< context >
<name>PathEdit < /name>
< message >
<location filename = "../utils/QtExtensions.py"
line = "128" / >
<source>Select
Path < /source>
< translation > Wähle
Pfad < /translation>
< /message>
< message >
<location filename = "../utils/QtExtensions.py"
line = "141" / >
<source>Choose
Path < /source>
< translation > Wähle
Pfad < /translation>
< /message>
< /context>
< context >
<name>TabWidget < /name>
< message >
<location filename = "../Components/TabWidget.py"
line = "16" / >
<source>Games < /source>
< translation > Spiele < /translation>
< /message>
< /context>
< /TS>