diff options
7 files changed, 190 insertions, 45 deletions
diff --git a/raveos-calamares-theme/PKGBUILD b/raveos-calamares-theme/PKGBUILD index e30ae5a..b08218d 100644 --- a/raveos-calamares-theme/PKGBUILD +++ b/raveos-calamares-theme/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: nippy <nippy@tuta.io> pkgname=raveos-calamares-theme pkgver=2.0.0 -pkgrel=62 +pkgrel=64 pkgdesc="RaveOS Calamares Theme" arch=('any') url="https://git.rp1.hu/RaveOS" @@ -27,4 +27,12 @@ package() { install -Dm755 "${startdir}/etc/calamares/modules/raveos-chown-homes.sh" \ "${pkgdir}/etc/calamares/modules/raveos-chown-homes.sh" + + # Branding fordítások: .ts -> .qm (lrelease) + local lrelease_bin + lrelease_bin="$(command -v lrelease6 || command -v lrelease || echo /usr/lib/qt6/bin/lrelease)" + for ts in "${startdir}"/etc/calamares/branding/raveos/lang/calamares-raveos_*.ts; do + [ -e "$ts" ] || continue + "${lrelease_bin}" "$ts" -qm "${pkgdir}/etc/calamares/branding/raveos/lang/$(basename "${ts%.ts}").qm" + done } diff --git a/raveos-calamares-theme/etc/calamares/branding/raveos/finishedq.qml b/raveos-calamares-theme/etc/calamares/branding/raveos/finishedq.qml index 7032bad..256edb2 100644 --- a/raveos-calamares-theme/etc/calamares/branding/raveos/finishedq.qml +++ b/raveos-calamares-theme/etc/calamares/branding/raveos/finishedq.qml @@ -5,7 +5,8 @@ * Sok nev eseten automatikusan lapoz (4s). A lista: supporters.js (import). * Ha nincs nev, a teljes tamogatoi panel el van rejtve. * - * Nyelvek: hu / de / en (Qt.locale() alapjan). + * Nyelvek: hu / de / en. A szovegek qsTr()-rel mennek, a branding + * calamares-raveos_<lang>.qm fordításokat a RaveWelcome tolti be. */ import io.calamares.core 1.0 @@ -26,19 +27,6 @@ Item { readonly property bool hasSupporters: Supporters.names.length > 0 readonly property int supportersPageCount: Math.max(1, Math.ceil(Supporters.names.length / supportersPerPage)) - // Aktualis nyelv: hu / de / en - readonly property string uiLang: { - var n = Qt.locale().name; - if (n.indexOf("hu") === 0) return "hu"; - if (n.indexOf("de") === 0) return "de"; - return "en"; - } - - // Forditas: t(hu, de, en) - function t(hu, de, en) { - return uiLang === "hu" ? hu : (uiLang === "de" ? de : en); - } - property int supportersPage: 0 // Az aktualis oldal szovege: soronkent 3 nev, kozepre igazitva @@ -85,7 +73,7 @@ Item { font.family: "Ubuntu" font.pixelSize: 26 font.bold: true - text: finishedRoot.t("A telepítés befejeződött", "Installation abgeschlossen", "Installation complete") + text: qsTr("Installation complete") } Text { @@ -95,15 +83,13 @@ Item { font.family: "Ubuntu" font.pixelSize: 15 wrapMode: Text.WordWrap - text: finishedRoot.t("Indítsd újra a rendszert a %1 használatához.".arg(Branding.string(Branding.ProductName)), - "Starten Sie das System neu, um %1 zu verwenden.".arg(Branding.string(Branding.ProductName)), - "Restart the system to start using %1.".arg(Branding.string(Branding.ProductName))) + text: qsTr("Restart the system to start using %1.").arg(Branding.string(Branding.ProductName)) } Button { id: restartButton Layout.alignment: Qt.AlignHCenter - text: finishedRoot.t("Újraindítás most", "Jetzt neu starten", "Restart now") + text: qsTr("Restart now") hoverEnabled: true onClicked: config.doRestart(true) @@ -152,7 +138,7 @@ Item { font.family: "Ubuntu" font.pixelSize: 15 font.bold: true - text: finishedRoot.t("RaveOS támogatók", "RaveOS-Unterstützer", "RaveOS Supporters") + text: qsTr("RaveOS Supporters") } Text { @@ -187,9 +173,7 @@ Item { font.pixelSize: 13 font.italic: true wrapMode: Text.WordWrap - text: finishedRoot.t("Köszönjük a támogatást, a csapat minden tagja nevében!", - "Vielen Dank für die Unterstützung, im Namen aller Teammitglieder!", - "Thank you for your support, from every member of the team!") + text: qsTr("Thank you for your support, from every member of the team!") } } } diff --git a/raveos-calamares-theme/etc/calamares/branding/raveos/lang/calamares-raveos_de.ts b/raveos-calamares-theme/etc/calamares/branding/raveos/lang/calamares-raveos_de.ts new file mode 100644 index 0000000..1d68d57 --- /dev/null +++ b/raveos-calamares-theme/etc/calamares/branding/raveos/lang/calamares-raveos_de.ts @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="de"> +<context> + <name>finishedq</name> + <message> + <source>Installation complete</source> + <translation>Installation abgeschlossen</translation> + </message> + <message> + <source>Restart the system to start using %1.</source> + <translation>Starten Sie das System neu, um %1 zu verwenden.</translation> + </message> + <message> + <source>Restart now</source> + <translation>Jetzt neu starten</translation> + </message> + <message> + <source>RaveOS Supporters</source> + <translation>RaveOS-Unterstützer</translation> + </message> + <message> + <source>Thank you for your support, from every member of the team!</source> + <translation>Vielen Dank für die Unterstützung, im Namen aller Teammitglieder!</translation> + </message> +</context> +<context> + <name>CalamaresWindow</name> + <message> + <source>&Restart</source> + <comment>@button</comment> + <translation>&Neu starten</translation> + </message> + <message> + <source>Restart the computer</source> + <comment>@tooltip</comment> + <translation>Den Computer neu starten</translation> + </message> +</context> +<context> + <name>raveos</name> + <message> + <source>Restart the computer?</source> + <translation>Computer neu starten?</translation> + </message> + <message> + <source>Restart</source> + <translation>Neu starten</translation> + </message> + <message> + <source>Cancel</source> + <translation>Abbrechen</translation> + </message> +</context> +</TS> diff --git a/raveos-calamares-theme/etc/calamares/branding/raveos/lang/calamares-raveos_en.ts b/raveos-calamares-theme/etc/calamares/branding/raveos/lang/calamares-raveos_en.ts new file mode 100644 index 0000000..cb44e1c --- /dev/null +++ b/raveos-calamares-theme/etc/calamares/branding/raveos/lang/calamares-raveos_en.ts @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="en"> +<context> + <name>finishedq</name> + <message> + <source>Installation complete</source> + <translation>Installation complete</translation> + </message> + <message> + <source>Restart the system to start using %1.</source> + <translation>Restart the system to start using %1.</translation> + </message> + <message> + <source>Restart now</source> + <translation>Restart now</translation> + </message> + <message> + <source>RaveOS Supporters</source> + <translation>RaveOS Supporters</translation> + </message> + <message> + <source>Thank you for your support, from every member of the team!</source> + <translation>Thank you for your support, from every member of the team!</translation> + </message> +</context> +<context> + <name>CalamaresWindow</name> + <message> + <source>&Restart</source> + <comment>@button</comment> + <translation>&Restart</translation> + </message> + <message> + <source>Restart the computer</source> + <comment>@tooltip</comment> + <translation>Restart the computer</translation> + </message> +</context> +<context> + <name>raveos</name> + <message> + <source>Restart the computer?</source> + <translation>Restart the computer?</translation> + </message> + <message> + <source>Restart</source> + <translation>Restart</translation> + </message> + <message> + <source>Cancel</source> + <translation>Cancel</translation> + </message> +</context> +</TS> diff --git a/raveos-calamares-theme/etc/calamares/branding/raveos/lang/calamares-raveos_hu.ts b/raveos-calamares-theme/etc/calamares/branding/raveos/lang/calamares-raveos_hu.ts new file mode 100644 index 0000000..27eddfa --- /dev/null +++ b/raveos-calamares-theme/etc/calamares/branding/raveos/lang/calamares-raveos_hu.ts @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE TS> +<TS version="2.1" language="hu"> +<context> + <name>finishedq</name> + <message> + <source>Installation complete</source> + <translation>A telepítés befejeződött</translation> + </message> + <message> + <source>Restart the system to start using %1.</source> + <translation>Indítsd újra a rendszert a %1 használatához.</translation> + </message> + <message> + <source>Restart now</source> + <translation>Újraindítás most</translation> + </message> + <message> + <source>RaveOS Supporters</source> + <translation>RaveOS támogatók</translation> + </message> + <message> + <source>Thank you for your support, from every member of the team!</source> + <translation>Köszönjük a támogatást, a csapat minden tagja nevében!</translation> + </message> +</context> +<context> + <name>CalamaresWindow</name> + <message> + <source>&Restart</source> + <comment>@button</comment> + <translation>&Újraindítás</translation> + </message> + <message> + <source>Restart the computer</source> + <comment>@tooltip</comment> + <translation>A számítógép újraindítása</translation> + </message> +</context> +<context> + <name>raveos</name> + <message> + <source>Restart the computer?</source> + <translation>Újraindítod a számítógépet?</translation> + </message> + <message> + <source>Restart</source> + <translation>Újraindítás</translation> + </message> + <message> + <source>Cancel</source> + <translation>Mégse</translation> + </message> +</context> +</TS> diff --git a/raveos-calamares/0003-restart-button.patch b/raveos-calamares/0003-restart-button.patch index bf8608e..0d8e0f4 100644 --- a/raveos-calamares/0003-restart-button.patch +++ b/raveos-calamares/0003-restart-button.patch @@ -8,19 +8,18 @@ #include "viewpages/ViewStep.h" #include <QApplication> -@@ -34,7 +35,11 @@ +@@ -34,7 +35,10 @@ #endif #include <QFile> #include <QFileInfo> +#include <QDialog> #include <QLabel> -+#include <QLocale> +#include <QProcess> +#include <QPushButton> #ifdef WITH_QML #include <QQmlContext> #include <QQmlEngine> -@@ -207,6 +212,49 @@ +@@ -207,6 +211,38 @@ return sideBox; } @@ -28,24 +27,13 @@ +static bool +raveosConfirmRestart( QWidget* parent ) +{ -+ const QString lang = QLocale().name(); -+ const bool hu = lang.startsWith( QStringLiteral( "hu" ) ); -+ const bool de = lang.startsWith( QStringLiteral( "de" ) ); -+ const QString question = hu ? QStringLiteral( "Újraindítod a számítógépet?" ) -+ : ( de ? QStringLiteral( "Computer neu starten?" ) -+ : QStringLiteral( "Restart the computer?" ) ); -+ const QString okText = hu ? QStringLiteral( "Újraindítás" ) -+ : ( de ? QStringLiteral( "Neu starten" ) : QStringLiteral( "Restart" ) ); -+ const QString cancelText = hu ? QStringLiteral( "Mégse" ) -+ : ( de ? QStringLiteral( "Abbrechen" ) : QStringLiteral( "Cancel" ) ); -+ + QDialog dialog( parent ); + dialog.setObjectName( QStringLiteral( "raveosDialog" ) ); + dialog.setWindowTitle( QStringLiteral( "RaveOS" ) ); + dialog.setMinimumWidth( 420 ); + + auto* layout = new QVBoxLayout( &dialog ); -+ auto* label = new QLabel( question, &dialog ); ++ auto* label = new QLabel( QCoreApplication::translate( "raveos", "Restart the computer?" ), &dialog ); + label->setObjectName( QStringLiteral( "raveosDialogLabel" ) ); + label->setWordWrap( true ); + layout->addWidget( label ); @@ -53,9 +41,9 @@ + + auto* buttons = new QHBoxLayout; + buttons->addStretch(); -+ auto* cancel = new QPushButton( cancelText, &dialog ); ++ auto* cancel = new QPushButton( QCoreApplication::translate( "raveos", "Cancel" ), &dialog ); + cancel->setObjectName( QStringLiteral( "raveosDialogCancel" ) ); -+ auto* ok = new QPushButton( okText, &dialog ); ++ auto* ok = new QPushButton( QCoreApplication::translate( "raveos", "Restart" ), &dialog ); + ok->setObjectName( QStringLiteral( "raveosDialogOk" ) ); + buttons->addWidget( cancel ); + buttons->addWidget( ok ); @@ -70,7 +58,7 @@ static QWidget* getWidgetNavigation( Calamares::DebugWindowManager*, Calamares::ViewManager* viewManager, -@@ -216,6 +264,45 @@ +@@ -216,6 +252,45 @@ { QWidget* navigation = new QWidget( parent ); QBoxLayout* bottomLayout = new QHBoxLayout; @@ -80,6 +68,7 @@ + { + auto* restart = new QPushButton( navigation ); + restart->setObjectName( "restartButton" ); ++ restart->setIcon( getButtonIcon( QStringLiteral( "view-refresh" ) ) ); + CALAMARES_RETRANSLATE_FOR( + restart, + restart->setText( QCoreApplication::translate( CalamaresWindow::staticMetaObject.className(), @@ -88,7 +77,6 @@ + restart->setToolTip( QCoreApplication::translate( CalamaresWindow::staticMetaObject.className(), + "Restart the computer", + "@tooltip" ) ); ); -+ restart->setIcon( getButtonIcon( QStringLiteral( "view-refresh" ) ) ); + QObject::connect( restart, + &QPushButton::clicked, + restart, @@ -116,7 +104,7 @@ bottomLayout->addStretch(); // Create buttons and sets an initial icon; the icons may change -@@ -272,7 +359,7 @@ +@@ -272,7 +347,7 @@ bottomLayout->addWidget( quit ); } diff --git a/raveos-calamares/PKGBUILD b/raveos-calamares/PKGBUILD index 59e9f90..2157aa6 100644 --- a/raveos-calamares/PKGBUILD +++ b/raveos-calamares/PKGBUILD @@ -4,7 +4,7 @@ _pkgname="calamares" pkgname="$_pkgname" pkgver=3.4.2 -pkgrel=12 +pkgrel=14 pkgdesc="Distribution-independent installer framework" url="https://codeberg.org/Calamares/calamares" license=("GPL-3.0-or-later") |