Fix bug translation placeholders.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-08-14 17:13:16 +03:00
parent 0b3342fe3d
commit 5a649d4747

View File

@ -693,10 +693,13 @@ QString VTranslateVars::PlaceholderToUserText(QString text) const
const QString translated = per + i.value().translate() + per;
const QString original = per + i.key() + per;
if (translated != original)
{
while (text.indexOf(original) != -1)
{
text.replace(original, translated);
}
}
++i;
}
return text;
@ -712,10 +715,13 @@ QString VTranslateVars::PlaceholderFromUserText(QString text) const
const QString translated = per + i.value().translate() + per;
const QString original = per + i.key() + per;
if (translated != original)
{
while (text.indexOf(translated) != -1)
{
text.replace(translated, original);
}
}
++i;
}
return text;