[rolisteam/rolisteam] src/libraries/core: [i18n]: fix translation of some text.

Renaud Guezennec <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 4d06605ef936a5513cb375cc5b1d262dd9d05794 by Renaud Guezennec.
Committed on 25/07/2026 at 11:20.
Pushed by renaudg into branch 'master'.

[i18n]: fix translation of some text.

M  +1    -1    src/libraries/core/include/model/nonplayablecharactermodel.h
M  +2    -3    src/libraries/core/src/model/characterstatemodel.cpp
M  +1    -1    src/libraries/core/src/model/dicealiasmodel.cpp
M  +2    -3    src/libraries/core/src/network/connectionprofile.cpp

https://invent.kde.org/rolisteam/rolisteam/-/commit/4d06605ef936a5513cb375cc5b1d262dd9d05794

diff --git a/src/libraries/core/include/model/nonplayablecharactermodel.h b/src/libraries/core/include/model/nonplayablecharactermodel.h
index d0e0cee2e..2c00b3938 100644
--- a/src/libraries/core/include/model/nonplayablecharactermodel.h
+++ b/src/libraries/core/include/model/nonplayablecharactermodel.h
@@ -147,7 +147,7 @@ public:
     void clear();
 
     const std::vector<std::unique_ptr<NonPlayableCharacter>>& npcList() const;
-    QStringList headers();
+    QStringList headers() const;
 
     QModelIndex indexFromUuid(const QString& id);
     NonPlayableCharacter* characterFromUuid(const QString& id);
diff --git a/src/libraries/core/src/model/characterstatemodel.cpp b/src/libraries/core/src/model/characterstatemodel.cpp
index f36182d87..a8ae4a3ce 100644
--- a/src/libraries/core/src/model/characterstatemodel.cpp
+++ b/src/libraries/core/src/model/characterstatemodel.cpp
@@ -89,7 +89,7 @@ QVariant CharacterStateModel::headerData(int section, Qt::Orientation orientatio
     {
         if(orientation == Qt::Horizontal)
         {
-            return m_header.at(section);
+            return tr(m_header.at(section).toStdString().c_str());
         }
     }
     return QVariant();
@@ -203,8 +203,7 @@ bool CharacterStateModel::setData(const QModelIndex& idx, const QVariant& value,
         break;
     }
 
-    emit dataChanged(index(idx.row(), 0), index(idx.row(), columnCount()),
-                     QList<int>() << role << roles[idx.column()]);
+    emit dataChanged(index(idx.row(), 0), index(idx.row(), columnCount()), QList<int>() << role << roles[idx.column()]);
     emit stateChanged();
     return result;
 }
diff --git a/src/libraries/core/src/model/dicealiasmodel.cpp b/src/libraries/core/src/model/dicealiasmodel.cpp
index b518f4c9a..cd2a3e01d 100644
--- a/src/libraries/core/src/model/dicealiasmodel.cpp
+++ b/src/libraries/core/src/model/dicealiasmodel.cpp
@@ -122,7 +122,7 @@ QVariant DiceAliasModel::headerData(int section, Qt::Orientation orientation, in
     {
         if(orientation == Qt::Horizontal)
         {
-            return m_header.at(section);
+            return tr(m_header.at(section).toStdString().c_str());
         }
     }
     return QVariant();
diff --git a/src/libraries/core/src/network/connectionprofile.cpp b/src/libraries/core/src/network/connectionprofile.cpp
index 6feb771b3..4a0b6de99 100644
--- a/src/libraries/core/src/network/connectionprofile.cpp
+++ b/src/libraries/core/src/network/connectionprofile.cpp
@@ -3,8 +3,7 @@
 #include <QCryptographicHash>
 #include <QDebug>
 
-ConnectionProfile::ConnectionProfile()
-    : m_title(QObject::tr("Unknown")), m_playerName(QObject::tr("Player")), m_playerColor(Qt::red)
+ConnectionProfile::ConnectionProfile() : m_playerName(QObject::tr("Player")), m_playerColor(Qt::red)
 {
     auto updateValid= [this]() {
         setValid(m_validConnectionInfo && m_validPlayerInfo && m_validCharacter && m_validCampaign
@@ -75,7 +74,7 @@ void ConnectionProfile::setGm(bool b)
 }
 QString ConnectionProfile::profileTitle() const
 {
-    return m_title;
+    return m_title.isEmpty() ? tr("Unknown") : m_title;
 }
 QString ConnectionProfile::playerName() const
 {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.