Skip to content

Commit e4852c9

Browse files
metsmaiannaska
authored andcommitted
Fix translations (#489)
IB-5814 Signed-off-by: Raul Metsma <[email protected]>
1 parent 8fcdae1 commit e4852c9

File tree

7 files changed

+51
-48
lines changed

7 files changed

+51
-48
lines changed

client/dialogs/AddRecipients.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ AddRecipients::AddRecipients(ItemList* itemList, QWidget *parent)
5454
setWindowFlags( Qt::Dialog | Qt::CustomizeWindowHint );
5555
setWindowModality( Qt::ApplicationModal );
5656

57-
ui->leftPane->init(ria::qdigidoc4::ToAddAdresses, tr("Add recipients"));
57+
ui->leftPane->init(ria::qdigidoc4::ToAddAdresses, QStringLiteral("Add recipients"));
5858
ui->leftPane->setFont(Styles::font(Styles::Regular, 20));
59-
ui->rightPane->init(ria::qdigidoc4::AddedAdresses, tr("Added recipients"));
59+
ui->rightPane->init(ria::qdigidoc4::AddedAdresses, QStringLiteral("Added recipients"));
6060
ui->rightPane->setFont(Styles::font(Styles::Regular, 20));
6161

6262
ui->fromCard->setFont(Styles::font(Styles::Condensed, 12));

client/translations/en.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,6 @@
103103
<source>Recipient’s certification chain contains certificates that are not trusted. Continue with encryption?</source>
104104
<translation>Recipient’s certification chain contains certificates that are not trusted. Continue with encryption?</translation>
105105
</message>
106-
<message>
107-
<source>Add recipients</source>
108-
<translation>Add recipients</translation>
109-
</message>
110-
<message>
111-
<source>Added recipients</source>
112-
<translation>Added recipients</translation>
113-
</message>
114106
</context>
115107
<context>
116108
<name>AddressItem</name>
@@ -954,6 +946,14 @@ The Information System Authority does not retain information regarding the files
954946
<source>Enter personal code, company or registry code</source>
955947
<translation>Enter personal code, company or registry code</translation>
956948
</message>
949+
<message>
950+
<source>Add recipients</source>
951+
<translation>Add recipients</translation>
952+
</message>
953+
<message>
954+
<source>Added recipients</source>
955+
<translation>Added recipients</translation>
956+
</message>
957957
</context>
958958
<context>
959959
<name>KeyDialog</name>

client/translations/et.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,6 @@
103103
<source>Recipient’s certification chain contains certificates that are not trusted. Continue with encryption?</source>
104104
<translation>Adressaadi sertifitseerimisahelas on mitteusaldatud sertifikaate. Jätkame krüpteerimist?</translation>
105105
</message>
106-
<message>
107-
<source>Add recipients</source>
108-
<translation>Lisa adressaadid</translation>
109-
</message>
110-
<message>
111-
<source>Added recipients</source>
112-
<translation>Lisatud adressaadid</translation>
113-
</message>
114106
</context>
115107
<context>
116108
<name>AddressItem</name>
@@ -954,6 +946,14 @@ Riigi Infosüsteemi Amet ei säilita informatsiooni teenuse kasutajate ja failid
954946
<source>Enter personal code, company or registry code</source>
955947
<translation>Sisesta isikukood, asutus või registrikood</translation>
956948
</message>
949+
<message>
950+
<source>Add recipients</source>
951+
<translation>Lisa adressaadid</translation>
952+
</message>
953+
<message>
954+
<source>Added recipients</source>
955+
<translation>Lisatud adressaadid</translation>
956+
</message>
957957
</context>
958958
<context>
959959
<name>KeyDialog</name>

client/translations/ru.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,6 @@
103103
<source>Recipient’s certification chain contains certificates that are not trusted. Continue with encryption?</source>
104104
<translation>Цепочка сертификатов получателя содержит ненадежные сертификаты. Продолжить шифрование?</translation>
105105
</message>
106-
<message>
107-
<source>Add recipients</source>
108-
<translation>Добавьте получателей</translation>
109-
</message>
110-
<message>
111-
<source>Added recipients</source>
112-
<translation>Добавлен получатель</translation>
113-
</message>
114106
</context>
115107
<context>
116108
<name>AddressItem</name>
@@ -955,6 +947,14 @@ The Information System Authority does not retain information regarding the files
955947
<source>Enter personal code, company or registry code</source>
956948
<translation>Введите личный код, учреждение или код регистра</translation>
957949
</message>
950+
<message>
951+
<source>Add recipients</source>
952+
<translation>Добавьте получателей</translation>
953+
</message>
954+
<message>
955+
<source>Added recipients</source>
956+
<translation>Добавлен получатель</translation>
957+
</message>
958958
</context>
959959
<context>
960960
<name>KeyDialog</name>

client/widgets/AddressItem.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,14 @@ AddressItem::AddressItem(CKey k, QWidget *parent, bool showIcon)
7676

7777
QString type, strDate;
7878

79-
auto certType = SslCertificate(key.cert).type();
80-
if(certType & SslCertificate::DigiIDType)
81-
type = tr("Digi-ID");
82-
else if(certType & SslCertificate::EstEidType)
83-
type = tr("ID-card");
84-
else if(certType & SslCertificate::TempelType)
85-
type = tr("e-Seal");
86-
else if(certType & SslCertificate::MobileIDType)
87-
type = tr("Mobile-ID");
88-
8979
if(!showIcon)
9080
{
9181
DateTime date(key.cert.expiryDate().toLocalTime());
9282
if(!date.isNull())
9383
strDate = date.formatDate(QStringLiteral("dd. MMMM yyyy"));
9484
}
9585

96-
update(name.toHtmlEscaped(), SslCertificate(key.cert).personalCode(), type, strDate, AddressItem::Remove);
86+
update(name.toHtmlEscaped(), SslCertificate(key.cert).personalCode(), SslCertificate(key.cert).type(), strDate, AddressItem::Remove);
9787
}
9888

9989
AddressItem::~AddressItem()
@@ -206,9 +196,9 @@ void AddressItem::stateChange(ContainerState state)
206196
ui->remove->setVisible(state == UnencryptedContainer);
207197
}
208198

209-
void AddressItem::update(const QString& cardName, const QString& cardCode, const QString& type, const QString& strDate, ShowToolButton show)
199+
void AddressItem::update(const QString& cardName, const QString& cardCode, SslCertificate::CertType type, const QString& strDate, ShowToolButton show)
210200
{
211-
typeText = type;
201+
m_type = type;
212202
expireDateText = strDate;
213203
code = cardCode;
214204
name = cardName;
@@ -222,7 +212,16 @@ void AddressItem::setIdType()
222212
{
223213
QString str;
224214
QTextStream st(&str);
225-
st << tr(qPrintable(typeText));
215+
QString typeText;
216+
if(m_type & SslCertificate::DigiIDType)
217+
typeText = tr("Digi-ID");
218+
else if(m_type & SslCertificate::EstEidType)
219+
typeText = tr("ID-card");
220+
else if(m_type & SslCertificate::TempelType)
221+
typeText = tr("e-Seal");
222+
else if(m_type & SslCertificate::MobileIDType)
223+
typeText = tr("Mobile-ID");
224+
st << typeText;
226225

227226
if(!expireDateText.isEmpty())
228227
{

client/widgets/AddressItem.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include "crypto/CryptoDoc.h"
2323
#include "widgets/Item.h"
2424

25+
#include <common/SslCertificate.h>
26+
2527
#include <memory>
2628

2729
namespace Ui {
@@ -52,7 +54,7 @@ class AddressItem : public Item
5254
void idChanged(const QString& cardCode, const QString& mobileCode, const QByteArray& serialNumber) override;
5355
void showButton(ShowToolButton show);
5456
void stateChange(ria::qdigidoc4::ContainerState state) override;
55-
void update(const QString& name, const QString& code, const QString &type, const QString& strDate, ShowToolButton show);
57+
void update(const QString& name, const QString& code, SslCertificate::CertType type, const QString& strDate, ShowToolButton show);
5658

5759
protected:
5860
void changeEvent(QEvent* event) override;
@@ -74,7 +76,7 @@ class AddressItem : public Item
7476
std::unique_ptr<QFontMetrics> nameMetrics;
7577
int nameWidth = 0;
7678
int reservedWidth = false;
77-
QString typeText;
79+
SslCertificate::CertType m_type;
7880
QString expireDateText;
7981
bool yourself = false;
8082
};

client/widgets/ItemList.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ItemList::ItemList(QWidget *parent)
3838
ui->download->hide();
3939
ui->count->setFont(Styles::font(Styles::Condensed, 12));
4040
ui->count->hide();
41-
connect(this, &ItemList::idChanged, [this](const QString &code, const QString &mobile, const QByteArray& serial)
41+
connect(this, &ItemList::idChanged, this, [this](const QString &code, const QString &mobile, const QByteArray& serial)
4242
{idCode = code; mobileCode = mobile; serialNumber = serial;});
4343
}
4444

@@ -57,8 +57,8 @@ void ItemList::addHeader(const QString &label)
5757
header->resize(415, 64);
5858
header->setFixedHeight(64);
5959
header->setFont( Styles::font(Styles::Regular, 20));
60-
header->setStyleSheet("border: solid rgba(217, 217, 216, 0.45);"
61-
"border-width: 0px 0px 1px 0px;");
60+
header->setStyleSheet(QStringLiteral("border: solid rgba(217, 217, 216, 0.45);"
61+
"border-width: 0px 0px 1px 0px;"));
6262
ui->itemLayout->insertWidget(0, header);
6363
headerItems++;
6464
}
@@ -73,6 +73,8 @@ void ItemList::changeEvent(QEvent* event)
7373
{
7474
if (event->type() == QEvent::LanguageChange)
7575
{
76+
tr("Add recipients");
77+
tr("Added recipients");
7678
tr("Recipients");
7779
tr("Encrypted files");
7880
tr("Container is not signed");
@@ -85,7 +87,7 @@ void ItemList::changeEvent(QEvent* event)
8587
ui->listHeader->setText(tr(qPrintable(listText)));
8688
ui->txtFind->setPlaceholderText(tr("Enter the personal code, institution or registry code"));
8789

88-
if(header != nullptr)
90+
if(header)
8991
header->setText(tr(qPrintable(headerText)));
9092

9193
ui->add->setText(addLabel());
@@ -201,8 +203,8 @@ void ItemList::init(ItemType item, const QString &header)
201203
ui->txtFind->setFont(Styles::font(Styles::Regular, 12));
202204
ui->findGroup->show();
203205
ui->txtFind->setPlaceholderText(tr("Enter personal code, company or registry code"));
204-
connect(ui->txtFind, &QLineEdit::returnPressed, [this](){ emit search(ui->txtFind->text()); });
205-
connect(ui->btnFind, &QPushButton::clicked, [this](){ emit search(ui->txtFind->text()); });
206+
connect(ui->txtFind, &QLineEdit::returnPressed, [this]{ emit search(ui->txtFind->text()); });
207+
connect(ui->btnFind, &QPushButton::clicked, [this]{ emit search(ui->txtFind->text()); });
206208
ui->btnFind->setDisabled(ui->txtFind->text().isEmpty());
207209
connect(ui->txtFind, &QLineEdit::textChanged, [=](const QString &text){
208210
ui->btnFind->setDisabled(text.isEmpty());

0 commit comments

Comments
 (0)