Browse Source

refactor: Removed HTML tags from translation

Fixed #2985.
pull/3703/head
Diadlo 9 years ago
parent
commit
da9366c70d
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
  1. 2
      src/widget/form/removefrienddialog.ui
  2. 6
      src/widget/tool/removefrienddialog.cpp

2
src/widget/form/removefrienddialog.ui

@ -23,7 +23,7 @@ @@ -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>

6
src/widget/tool/removefrienddialog.cpp

@ -8,7 +8,11 @@ RemoveFriendDialog::RemoveFriendDialog(QWidget *parent, const Friend *f) @@ -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"));

Loading…
Cancel
Save