From 9436b066ff3f6760036fb115ba97a89fb672e46c Mon Sep 17 00:00:00 2001 From: vtexier <vit@free.fr> Date: Thu, 5 Mar 2020 23:29:42 +0100 Subject: [PATCH] [fix] fix identities table model translation --- .../gui/navigation/identities/table_model.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sakia/gui/navigation/identities/table_model.py b/src/sakia/gui/navigation/identities/table_model.py index 4e6b2e16..83d45ed7 100644 --- a/src/sakia/gui/navigation/identities/table_model.py +++ b/src/sakia/gui/navigation/identities/table_model.py @@ -8,7 +8,7 @@ from PyQt5.QtCore import ( QModelIndex, QLocale, QT_TRANSLATE_NOOP, -) + QCoreApplication) from PyQt5.QtGui import QColor, QIcon, QFont import logging import asyncio @@ -145,14 +145,14 @@ class IdentitiesTableModel(QAbstractTableModel): """ columns_titles = { - "uid": lambda: QT_TRANSLATE_NOOP("IdentitiesTableModel", "UID"), - "pubkey": lambda: QT_TRANSLATE_NOOP("IdentitiesTableModel", "Pubkey"), - "renewed": lambda: QT_TRANSLATE_NOOP("IdentitiesTableModel", "Renewed"), - "expiration": lambda: QT_TRANSLATE_NOOP("IdentitiesTableModel", "Expiration"), - "publication": lambda: QT_TRANSLATE_NOOP( + "uid": QT_TRANSLATE_NOOP("IdentitiesTableModel", "UID"), + "pubkey": QT_TRANSLATE_NOOP("IdentitiesTableModel", "Pubkey"), + "renewed": QT_TRANSLATE_NOOP("IdentitiesTableModel", "Renewed"), + "expiration": QT_TRANSLATE_NOOP("IdentitiesTableModel", "Expiration"), + "publication": QT_TRANSLATE_NOOP( "IdentitiesTableModel", "Publication" ), - "block": lambda: QT_TRANSLATE_NOOP("IdentitiesTableModel", "Publication Block"), + "block": QT_TRANSLATE_NOOP("IdentitiesTableModel", "Publication Block"), } columns_ids = ( "uid", @@ -248,7 +248,7 @@ class IdentitiesTableModel(QAbstractTableModel): def headerData(self, section, orientation, role): if role == Qt.DisplayRole: col_id = IdentitiesTableModel.columns_ids[section] - return IdentitiesTableModel.columns_titles[col_id]() + return QCoreApplication.translate("IdentitiesTableModel", IdentitiesTableModel.columns_titles[col_id]) def data(self, index, role): if index.isValid() and role == Qt.DisplayRole: -- GitLab