feat(i18n): wrap the interface and the journal wording in tr()

Every label, tooltip, empty state and status message was a bare
QStringLiteral, so nothing could be translated. They now go through tr()
(QCoreApplication::translate from a free helper, QT_TRANSLATE_NOOP where
the code already had it), which is what the catalogues are keyed on.

The journal follows the same rule as the interface: an event, an error and
the two outcomes of a command read in the chosen language. What the tools
print themselves is left alone — that is their output, not our wording —
and so are the qC* developer traces, which keep their technical English.
This commit is contained in:
BlackAngelTV committed 2026-09-29 21:17:49 +02:00
1 parent a26051795f
commit 459a8f045e
11 files changed
+430 -423

No files matched your search

+18 -18
View File
@@ -21,13 +21,13 @@ DashboardPage::DashboardPage(AppCore* core, QWidget* parent) : Page(core, parent
QHBoxLayout* statsRow = new QHBoxLayout();
statsRow->setSpacing(12);
statsRow->addWidget(
ui::statCard("package", "Paquets installés", "blue", &m_statInstalled));
ui::statCard("package", tr("Paquets installés"), "blue", &m_statInstalled));
statsRow->addWidget(
ui::statCard("arrow-up", "Mises à jour dispo", "amber", &m_statUpdates));
ui::statCard("arrow-up", tr("Mises à jour dispo"), "amber", &m_statUpdates));
statsRow->addWidget(
ui::statCard("history", "Actions enregistrées", "cyan", &m_statHistory));
ui::statCard("history", tr("Actions enregistrées"), "cyan", &m_statHistory));
statsRow->addWidget(
ui::statCard("tools", "Gestionnaire", "green", &m_statManager));
ui::statCard("tools", tr("Gestionnaire"), "green", &m_statManager));
layout->addLayout(statsRow);
// Quick actions
@@ -36,48 +36,48 @@ DashboardPage::DashboardPage(AppCore* core, QWidget* parent) : Page(core, parent
actionsLayout->setContentsMargins(18, 16, 18, 16);
actionsLayout->setSpacing(10);
QLabel* actionsTitle = new QLabel("ACTIONS RAPIDES");
QLabel* actionsTitle = new QLabel(tr("ACTIONS RAPIDES"));
actionsTitle->setObjectName("cardTitle");
actionsLayout->addWidget(actionsTitle);
QHBoxLayout* actionsRow = new QHBoxLayout();
actionsRow->setSpacing(10);
QPushButton* btnSearch = new QPushButton("Rechercher un paquet");
QPushButton* btnSearch = new QPushButton(tr("Rechercher un paquet"));
btnSearch->setProperty("variant", "primary");
btnSearch->setIcon(ui::icon("search"));
connect(btnSearch, &QPushButton::clicked, this,
[this] { emit goToPage("search"); });
actionsRow->addWidget(btnSearch);
QPushButton* btnInstalled = new QPushButton("Paquets installés");
QPushButton* btnInstalled = new QPushButton(tr("Paquets installés"));
btnInstalled->setIcon(ui::icon("package"));
connect(btnInstalled, &QPushButton::clicked, this,
[this] { emit goToPage("installed"); });
actionsRow->addWidget(btnInstalled);
QPushButton* btnUpdateAll = new QPushButton("Tout mettre à jour");
QPushButton* btnUpdateAll = new QPushButton(tr("Tout mettre à jour"));
btnUpdateAll->setProperty("variant", "warning");
btnUpdateAll->setIcon(ui::icon("arrow-up"));
connect(btnUpdateAll, &QPushButton::clicked, this,
[this, core] { start(core->updateAll(), tr("Mise à jour globale")); });
actionsRow->addWidget(btnUpdateAll);
QPushButton* btnCleanup = new QPushButton("Nettoyer le système");
QPushButton* btnCleanup = new QPushButton(tr("Nettoyer le système"));
btnCleanup->setIcon(ui::icon("broom"));
btnCleanup->setToolTip("Purger les paquets inutilisés et vider les caches");
btnCleanup->setToolTip(tr("Purger les paquets inutilisés et vider les caches"));
connect(btnCleanup, &QPushButton::clicked, this,
[this] { emit goToPage("cleanup"); });
actionsRow->addWidget(btnCleanup);
QPushButton* btnRefresh = new QPushButton("Rafraîchir les sources");
QPushButton* btnRefresh = new QPushButton(tr("Rafraîchir les sources"));
btnRefresh->setProperty("variant", "info");
btnRefresh->setIcon(ui::icon("refresh"));
connect(btnRefresh, &QPushButton::clicked, this,
[this, core] { start(core->refresh(), tr("Rafraîchissement des sources")); });
actionsRow->addWidget(btnRefresh);
QPushButton* btnLogs = new QPushButton("Logs pacman");
QPushButton* btnLogs = new QPushButton(tr("Logs pacman"));
btnLogs->setIcon(ui::icon("logs"));
connect(btnLogs, &QPushButton::clicked, this, [this] { emit goToPage("logs"); });
actionsRow->addWidget(btnLogs);
@@ -92,7 +92,7 @@ DashboardPage::DashboardPage(AppCore* core, QWidget* parent) : Page(core, parent
recentLayout->setContentsMargins(18, 16, 18, 12);
recentLayout->setSpacing(8);
QLabel* recentTitle = new QLabel("ACTIVITÉ RÉCENTE");
QLabel* recentTitle = new QLabel(tr("ACTIVITÉ RÉCENTE"));
recentTitle->setObjectName("cardTitle");
recentLayout->addWidget(recentTitle);
@@ -142,7 +142,7 @@ void DashboardPage::refreshRecentActivity() {
const auto& history = core()->history()->getHistory();
if (history.empty()) {
QListWidgetItem* empty =
new QListWidgetItem("Aucune action enregistrée pour le moment");
new QListWidgetItem(tr("Aucune action enregistrée pour le moment"));
empty->setFlags(Qt::NoItemFlags);
empty->setTextAlignment(Qt::AlignCenter);
m_recentList->addItem(empty);
@@ -173,13 +173,13 @@ void DashboardPage::refreshRecentActivity() {
// card background the badge sits on.
QString actionText, actionBg, actionFg;
if (entry.action == "install") {
actionText = "Installation"; actionBg = "#213d46"; actionFg = "#34d399";
actionText = tr("Installation"); actionBg = "#213d46"; actionFg = "#34d399";
} else if (entry.action == "remove") {
actionText = "Suppression"; actionBg = "#383241"; actionFg = "#f87171";
actionText = tr("Suppression"); actionBg = "#383241"; actionFg = "#f87171";
} else if (entry.action == "cleanup") {
actionText = "Nettoyage"; actionBg = "#213b52"; actionFg = "#7dd3fc";
actionText = tr("Nettoyage"); actionBg = "#213b52"; actionFg = "#7dd3fc";
} else {
actionText = "Mise à jour"; actionBg = "#393b38"; actionFg = "#fbbf24";
actionText = tr("Mise à jour"); actionBg = "#393b38"; actionFg = "#fbbf24";
}
rowLayout->addWidget(ui::badge(actionText, actionBg, actionFg));