1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

refactor: Removed HTML tags from translation

Fixed #2985.
This commit is contained in:
Diadlo 2016-09-11 00:00:26 +03:00
parent a7ddf5ef56
commit da9366c70d
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
2 changed files with 6 additions and 2 deletions

View File

@ -23,7 +23,7 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Are you sure you want to remove &lt;span style=&quot; font-weight:600;&quot;&gt;&amp;lt;name&amp;gt;&lt;/span&gt; from your contacts list?&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string notr="true">{Text message}</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>

View File

@ -8,7 +8,11 @@ RemoveFriendDialog::RemoveFriendDialog(QWidget *parent, const Friend *f)
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
setAttribute(Qt::WA_QuitOnClose, false);
ui.setupUi(this);
ui.label->setText(ui.label->text().replace("&lt;name&gt;", f->getDisplayedName().toHtmlEscaped()));
QString name = f->getDisplayedName().toHtmlEscaped();
QString text = tr("Are you sure you want to remove %1 from your contacts list?")
.arg(QString("<b>%1</b>").arg(name));
ui.label->setText(text);
auto removeButton = ui.buttonBox->button(QDialogButtonBox::Ok);
auto cancelButton = ui.buttonBox->button(QDialogButtonBox::Cancel);
removeButton->setText(tr("Remove"));