Skip to content

Commit

Permalink
Update texts (open-eid#1136)
Browse files Browse the repository at this point in the history
IB-7546

Signed-off-by: Raul Metsma <[email protected]>

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored Dec 21, 2022
1 parent 774bb15 commit 218a7c1
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 31 deletions.
7 changes: 4 additions & 3 deletions client/CryptoDoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -818,12 +818,13 @@ bool CDocumentModel::addFile(const QString &file, const QString &mime)
QFileInfo info(file);
if(info.size() == 0)
{
WarningDialog(tr("Cannot add empty file to the container."), qApp->mainWindow()).exec();
WarningDialog::show(qApp->activeWindow(), tr("Cannot add empty file to the container."));
return false;
}
if(info.size() > 120*1024*1024)
{
WarningDialog(tr("Added file(s) exceeds the maximum size limit of the container(120MB)."), qApp->activeWindow()).exec();
WarningDialog::show(qApp->activeWindow(), tr("Added file(s) exceeds the maximum size limit of the container (∼120MB). "
"<a href='https://www.id.ee/en/article/encrypting-large-120-mb-files/'>Read more about it</a>"));
return false;
}

Expand All @@ -833,7 +834,7 @@ bool CDocumentModel::addFile(const QString &file, const QString &mime)
qDebug() << containerFile.name << " vs " << file;
if(containerFile.name == fileName)
{
d->setLastError(DocumentModel::tr("Cannot add the file to the envelope. File '%1' is already in container.")
WarningDialog::show(qApp->activeWindow(), DocumentModel::tr("Cannot add the file to the envelope. File '%1' is already in container.")
.arg(FileDialog::normalized(fileName)));
return false;
}
Expand Down
15 changes: 7 additions & 8 deletions client/dialogs/AddRecipients.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void AddRecipients::addRecipientFromFile()
QFile f( file );
if( !f.open( QIODevice::ReadOnly ) )
{
WarningDialog::warning(this, tr("Failed to read certificate"));
WarningDialog::show(this, tr("Failed to read certificate"));
return;
}

Expand All @@ -170,18 +170,17 @@ void AddRecipients::addRecipientFromFile()
}
if( cert.isNull() )
{
WarningDialog::warning( this, tr("Failed to read certificate"));
WarningDialog::show( this, tr("Failed to read certificate"));
}
else if( !SslCertificate( cert ).keyUsage().contains( SslCertificate::KeyEncipherment ) &&
!SslCertificate( cert ).keyUsage().contains( SslCertificate::KeyAgreement ) )
{
WarningDialog::warning( this, tr("This certificate cannot be used for encryption"));
WarningDialog::show( this, tr("This certificate cannot be used for encryption"));
}
else if(AddressItem *item = addRecipientToLeftPane(cert))
{
addRecipientToRightPane(item, true);
}
f.close();
}

void AddRecipients::addRecipientFromHistory()
Expand Down Expand Up @@ -409,7 +408,7 @@ void AddRecipients::search(const QString &term, bool select, const QString &type
if(!IKValidator::isValid(cleanTerm))
{
QApplication::restoreOverrideCursor();
WarningDialog::warning(this, tr("Personal code is not valid!"));
WarningDialog::show(this, tr("Personal code is not valid!"));
return;
}
userData["personSearch"] = true;
Expand All @@ -427,7 +426,7 @@ void AddRecipients::search(const QString &term, bool select, const QString &type
void AddRecipients::showError( const QString &msg, const QString &details )
{
QApplication::restoreOverrideCursor();
WarningDialog(msg, details, this).exec();
WarningDialog::show(this, msg, details);
}

void AddRecipients::showResult(const QList<QSslCertificate> &result, int resultCount, const QVariantMap &userData)
Expand All @@ -454,8 +453,8 @@ void AddRecipients::showResult(const QList<QSslCertificate> &result, int resultC
else if(isEmpty)
{
showError(tr("Person or company does not own a valid certificate.<br />"
"It is necessary to have a valid certificate for encryption.<br />"
"In case of questions please contact our support via <a href=\"https://www.id.ee/en/\">id.ee</a>."));
"It is necessary to have a valid certificate for encryption.<br />"
"<a href='https://www.id.ee/en/article/encryption-and-decryption-of-documents/'>Read more about it</a>."));
}
QApplication::restoreOverrideCursor();
}
Expand Down
5 changes: 0 additions & 5 deletions client/dialogs/WarningDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,3 @@ void WarningDialog::show(QWidget *parent, const QString &text, const QString &de
dlg->setAttribute(Qt::WA_DeleteOnClose);
dlg->open();
}

void WarningDialog::warning(QWidget *parent, const QString& text)
{
WarningDialog(text, {}, parent).exec();
}
1 change: 0 additions & 1 deletion client/dialogs/WarningDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class WarningDialog : public QDialog
void resetCancelStyle();
void setText(const QString& text);
static void show(QWidget *parent, const QString &text, const QString &details = {});
static void warning(QWidget *parent, const QString& text);

private:
Ui::WarningDialog *ui;
Expand Down
8 changes: 4 additions & 4 deletions client/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
<translation>Personal code is not valid!</translation>
</message>
<message>
<source>Person or company does not own a valid certificate.&lt;br /&gt;It is necessary to have a valid certificate for encryption.&lt;br /&gt;In case of questions please contact our support via &lt;a href=&quot;https://www.id.ee/en/&quot;&gt;id.ee&lt;/a&gt;.</source>
<translation>Person or company does not own a valid certificate.&lt;br /&gt;It is necessary to have a valid certificate for encryption.&lt;br /&gt;In case of questions please contact our support via &lt;a href=&quot;https://www.id.ee/en/&quot;&gt;id.ee&lt;/a&gt;.</translation>
<source>Person or company does not own a valid certificate.&lt;br /&gt;It is necessary to have a valid certificate for encryption.&lt;br /&gt;&lt;a href=&apos;https://www.id.ee/en/article/encryption-and-decryption-of-documents/&apos;&gt;Read more about it&lt;/a&gt;.</source>
<translation>Person or company does not own a valid certificate.&lt;br /&gt;It is necessary to have a valid certificate for encryption.&lt;br /&gt;&lt;a href=&apos;https://www.id.ee/en/article/encryption-and-decryption-of-documents/&apos;&gt;Read more about it&lt;/a&gt;.</translation>
</message>
<message>
<source>Certificates (*.cer *.crt *.pem)</source>
Expand Down Expand Up @@ -265,8 +265,8 @@
<translation>Cannot add empty file to the container.</translation>
</message>
<message>
<source>Added file(s) exceeds the maximum size limit of the container(120MB).</source>
<translation>Added file(s) exceeds the maximum size limit of the container (~120MB).</translation>
<source>Added file(s) exceeds the maximum size limit of the container (∼120MB). &lt;a href=&apos;https://www.id.ee/en/article/encrypting-large-120-mb-files/&apos;&gt;Read more about it&lt;/a&gt;</source>
<translation>Added file(s) exceeds the maximum size limit of the container (120MB). &lt;a href=&apos;https://www.id.ee/en/article/encrypting-large-120-mb-files/&apos;&gt;Read more about it&lt;/a&gt;</translation>
</message>
</context>
<context>
Expand Down
8 changes: 4 additions & 4 deletions client/translations/et.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
<translation>Isikukood pole korrektne!</translation>
</message>
<message>
<source>Person or company does not own a valid certificate.&lt;br /&gt;It is necessary to have a valid certificate for encryption.&lt;br /&gt;In case of questions please contact our support via &lt;a href=&quot;https://www.id.ee/en/&quot;&gt;id.ee&lt;/a&gt;.</source>
<translation>Isikul või asutusel puudub kehtiv sertifikaat.&lt;br /&gt;Krüpteerimiseks on vaja kehtivat sertifikaati.&lt;br /&gt;Küsimuste korral võta ühendust &lt;a href=&quot;https://www.id.ee/&quot;&gt;ID-abikeskusega&lt;/a&gt;.</translation>
<source>Person or company does not own a valid certificate.&lt;br /&gt;It is necessary to have a valid certificate for encryption.&lt;br /&gt;&lt;a href=&apos;https://www.id.ee/en/article/encryption-and-decryption-of-documents/&apos;&gt;Read more about it&lt;/a&gt;.</source>
<translation>Isikul või asutusel puudub kehtiv sertifikaat.&lt;br /&gt;Krüpteerimiseks on vaja kehtivat sertifikaati.&lt;br /&gt;&lt;a href=&apos;https://www.id.ee/artikkel/dokumentide-krupteerimine-ja-dekrupteerimine/&apos;&gt;Loe täpsemalt siit&lt;/a&gt;.</translation>
</message>
<message>
<source>Certificates (*.cer *.crt *.pem)</source>
Expand Down Expand Up @@ -265,8 +265,8 @@
<translation>Tühja faili ei saa lisada ümbrikusse.</translation>
</message>
<message>
<source>Added file(s) exceeds the maximum size limit of the container(120MB).</source>
<translation>Lisatud fail(id) ületab turvaümbriku maksimaalset suurust (~120MB).</translation>
<source>Added file(s) exceeds the maximum size limit of the container (∼120MB). &lt;a href=&apos;https://www.id.ee/en/article/encrypting-large-120-mb-files/&apos;&gt;Read more about it&lt;/a&gt;</source>
<translation>Lisatud fail(id) ületab turvaümbriku maksimaalset suurust (~120MB). &lt;a href=&apos;https://www.id.ee/artikkel/suuremahuliste-120-mb-failide-krupteerimine/&apos;&gt;Loe täpsemalt siit&lt;/a&gt;</translation>
</message>
</context>
<context>
Expand Down
8 changes: 4 additions & 4 deletions client/translations/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
<translation>Личный код недействителен!</translation>
</message>
<message>
<source>Person or company does not own a valid certificate.&lt;br /&gt;It is necessary to have a valid certificate for encryption.&lt;br /&gt;In case of questions please contact our support via &lt;a href=&quot;https://www.id.ee/en/&quot;&gt;id.ee&lt;/a&gt;.</source>
<translationлица или учреждения отсутствует действующий сертификат.&lt;br /&gt;Для зашифровывания необходим действующий сертификат.&lt;br /&gt;Если у вас возникнут вопросы, пожалуйста, обратитесь за помощью через &lt;a href=&quot;https://www.id.ee/ru/&quot;&gt;id.ee&lt;/a&gt;.</translation>
<source>Person or company does not own a valid certificate.&lt;br /&gt;It is necessary to have a valid certificate for encryption.&lt;br /&gt;&lt;a href=&apos;https://www.id.ee/en/article/encryption-and-decryption-of-documents/&apos;&gt;Read more about it&lt;/a&gt;.</source>
<translationчеловека или предприятия отсутствует действующий сертификат.&lt;br /&gt;Для шифрования нужен действующий сертификат.&lt;br /&gt;&lt;a href=&apos;https://www.id.ee/ru/artikkel/shifrovanie-i-deshifrovka-dokumentov/&apos;&gt;Точнее можно прочитать&lt;/a&gt;</translation>
</message>
<message>
<source>Certificates (*.cer *.crt *.pem)</source>
Expand Down Expand Up @@ -265,8 +265,8 @@
<translation>Пустой файл нельзя добавить в контейнер.</translation>
</message>
<message>
<source>Added file(s) exceeds the maximum size limit of the container(120MB).</source>
<translation>Вложенные файл(ы) превышают размер контейнера безопасности (~120 МБ).</translation>
<source>Added file(s) exceeds the maximum size limit of the container (∼120MB). &lt;a href=&apos;https://www.id.ee/en/article/encrypting-large-120-mb-files/&apos;&gt;Read more about it&lt;/a&gt;</source>
<translation>Добаленные файл превышают максимальный размер контейнера. &lt;a href=&apos;https://www.id.ee/ru/artikkel/kriptovanie-fajlov-s-bolshim-obemom-120-mb/&apos;&gt;Точнее можно прочитать&lt;/a&gt;</translation>
</message>
</context>
<context>
Expand Down
2 changes: 1 addition & 1 deletion client/widgets/VerifyCert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ VerifyCert::VerifyCert(QWidget *parent)
default:
msg = tr("Certificate status check failed. Please check your internet connection.");
}
WarningDialog::warning(this, msg);
WarningDialog::show(this, msg);
});

ui->nameIcon->hide();
Expand Down
2 changes: 1 addition & 1 deletion common

0 comments on commit 218a7c1

Please sign in to comment.