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:
11 files changed
+430
-423
No files matched your search
+7
-7
@@ -20,10 +20,10 @@ LogsPage::LogsPage(AppCore* core, QWidget* parent) : Page(core, parent) {
|
||||
filterRow->setSpacing(10);
|
||||
|
||||
m_source = new QComboBox();
|
||||
m_source->addItem(QStringLiteral("Journal de l'application"));
|
||||
m_source->addItem(QStringLiteral("Journal pacman (/var/log/pacman.log)"));
|
||||
m_source->addItem(tr("Journal de l'application"));
|
||||
m_source->addItem(tr("Journal pacman (/var/log/pacman.log)"));
|
||||
m_source->setMinimumHeight(36);
|
||||
m_source->setToolTip("Choisir la source du journal affiché");
|
||||
m_source->setToolTip(tr("Choisir la source du journal affiché"));
|
||||
connect(m_source, &QComboBox::currentIndexChanged, this, [this](int) { load(); });
|
||||
filterRow->addWidget(m_source);
|
||||
|
||||
@@ -31,7 +31,7 @@ LogsPage::LogsPage(AppCore* core, QWidget* parent) : Page(core, parent) {
|
||||
// Drops go to the window, which installs Flatpak files (see
|
||||
// MainWindow::dragEnterEvent) rather than pasting a path here.
|
||||
m_filter->setAcceptDrops(false);
|
||||
m_filter->setPlaceholderText("Filtrer les logs (paquet, action, date)...");
|
||||
m_filter->setPlaceholderText(tr("Filtrer les logs (paquet, action, date)..."));
|
||||
m_filter->setMinimumHeight(36);
|
||||
m_filter->setClearButtonEnabled(true);
|
||||
m_filter->addAction(ui::icon("filter"), QLineEdit::LeadingPosition);
|
||||
@@ -49,7 +49,7 @@ LogsPage::LogsPage(AppCore* core, QWidget* parent) : Page(core, parent) {
|
||||
QHBoxLayout* buttonBar = new QHBoxLayout();
|
||||
buttonBar->addStretch();
|
||||
|
||||
QPushButton* refreshButton = new QPushButton("Recharger");
|
||||
QPushButton* refreshButton = new QPushButton(tr("Recharger"));
|
||||
refreshButton->setIcon(ui::icon("refresh"));
|
||||
connect(refreshButton, &QPushButton::clicked, this, [this] {
|
||||
load();
|
||||
@@ -86,8 +86,8 @@ void LogsPage::load() {
|
||||
}
|
||||
if (m_raw.isEmpty()) {
|
||||
m_text->setPlainText(viewingAppLog()
|
||||
? QStringLiteral("Journal vide : rien n'a encore été enregistré.")
|
||||
: QStringLiteral("Journal pacman vide ou illisible."));
|
||||
? tr("Journal vide : rien n'a encore été enregistré.")
|
||||
: tr("Journal pacman vide ou illisible."));
|
||||
return;
|
||||
}
|
||||
applyFilter();
|
||||
|
||||
Reference in new issue
Block a user