Make the cable feature speak English like the rest of the interface

English has been the source language of the program for a while now
(upstream: "Make English the source language ..."), the cable feature
came in with French ones: about 200 translatable strings over 30 files,
the two settings pages built from .ui files, four comments and one test
which asserted the old wording (blocking review comment by ispyisail).

The wording follows what the code base already uses where it exists:
Plant (=) and Location (+) as qetinformation.cpp names those element
information, Designation for the field the cable form calls its BMK,
Length, Sheet for folio, Automatic numbering, Cross-reference, and Right
aligned / Centred / Left aligned the way cabletextformatdialog.cpp
already spells the three alignment entries.

Two things are more than a word-for-word swap:

- xrefpropertieswidget.cpp:291 wrote the label of the master field on
  every type change with a hardcoded tr("Maitre"), so the English
  "Master" coming from the .ui was overwritten for every type, cable or
  not: a real bug next to being French. The wording now comes back from
  the .ui and only a cable renames the field to "Text:", so the two
  cannot drift apart again.

- tst_cabletypelist kept asserting that a new catalogue is *labelled*
  in French. That label line is the translated header and reads English
  now. The test still reads files with French headers on purpose:
  headerAliasMap() keeps the five old French labels as aliases next to
  the English ones, so catalogues written by earlier builds, including
  the one the reviewer reads her own types from, keep loading.

The .ts files are deliberately not regenerated here. Upstream
regenerates them on master, as it did for the language change itself,
and a translation is keyed on the source string: while the sources were
French a German user saw French in the cable dialogs, and an English
source string with no translation yet shows as it is.

Build clean, ctest 92/93, the one failure being the pre-existing
headless tst_menubarkeyboard.
This commit is contained in:
Kellermorph
2026-10-10 13:48:45 +02:00
parent 3f23e3dd2b
commit 9771ca96c9
30 changed files with 375 additions and 350 deletions
+10 -10
View File
@@ -51,7 +51,7 @@ CablePropertiesDialog::CablePropertiesDialog(Cable *cable,
m_diagram(diagram),
m_part(part)
{
setWindowTitle(tr("Câble"));
setWindowTitle(tr("Cable"));
auto *layout = new QVBoxLayout(this);
m_fields = new CablePropertiesWidget(this);
@@ -70,13 +70,13 @@ CablePropertiesDialog::CablePropertiesDialog(Cable *cable,
//The cores the type offers which are not on the sheet yet.
//Double-clicking one brings it in: the line it was asked from
//takes the mouse and the next click puts the core down there.
m_free_label = new QLabel(tr("Âmes non placées :"), this);
m_free_label = new QLabel(tr("Unplaced cores:"), this);
m_free_cores = new QListWidget(this);
m_free_cores->setSelectionMode(QAbstractItemView::SingleSelection);
m_free_cores->setAlternatingRowColors(true);
m_free_cores->setToolTip(tr("Double-cliquer sur une âme pour la poser sur la "
"ligne : le trait suit la souris et le clic la "
"laisse à l'endroit visé."));
m_free_cores->setToolTip(tr("Double-click a core to place it on the "
"line: the line follows the mouse and a "
"click leaves it where you aimed."));
m_free_cores->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_free_cores, &QWidget::customContextMenuRequested,
this, &CablePropertiesDialog::freeCoreMenu);
@@ -114,11 +114,11 @@ void CablePropertiesDialog::updateCoreCount()
if (!m_cable)
{
m_cores->setText(tr("Aucun câble."));
m_cores->setText(tr("No cable."));
return;
}
m_cores->setText(tr("%1 âme(s) sur %2 reliée(s) à un conducteur",
m_cores->setText(tr("%1 of %2 cores wired to a conductor",
"how many cores of this cable are wired",
m_cable->usedCoreCount())
.arg(m_cable->usedCoreCount())
@@ -168,8 +168,8 @@ void CablePropertiesDialog::fillFreeCores()
const QString color = m_cable->colorOfCore(i);
auto *item = new QListWidgetItem(
color.isEmpty() ? tr("Âme %1").arg(i + 1)
: tr("Âme %1 — %2").arg(i + 1).arg(color),
color.isEmpty() ? tr("Core %1").arg(i + 1)
: tr("Core %1 — %2").arg(i + 1).arg(color),
m_free_cores);
item->setData(Qt::UserRole, i);
}
@@ -230,7 +230,7 @@ void CablePropertiesDialog::freeCoreMenu(const QPoint &pos)
m_free_cores->setCurrentItem(item);
QMenu menu(m_free_cores);
QAction *place = menu.addAction(tr("Placer cette âme sur la ligne"));
QAction *place = menu.addAction(tr("Place this core on the line"));
place->setIcon(QET::Icons::Cable);
if (menu.exec(m_free_cores->viewport()->mapToGlobal(pos)) == place) {