<table><tr><td style="">jfita created this revision.<br />jfita added reviewers: staniek, piggz.<br />Herald added a project: KEXI.<br />Herald added a subscriber: Kexi-Devel-list.<br />jfita requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D29804">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>If there is any error during a migration, Kexi gets the error message<br />
already formatted in HTML from KDb and tries to mix this error message<br />
with a markup-aware KLocalizedString. However, KI18n escapes all QString<br />
arguments and the user sees the HTML tags in the error message.<br />
Therefore, it left out the replacement of placeholders until it got the<br />
translated QString, avoiding the escaping.</p>

<p>However, when KI18n is compiled with NDEBUG defined it adds a<br />
(I18N_ARGUMENT_MISSING) warning into the translated string when the<br />
source has placeholders that have not been replaced.</p>

<p>The way of avoiding escaping with KI18n is to replace the placeholders<br />
with another markup-aware KLocalizedString.  That can be done in<br />
checkUserInput because all the error messages are defined within the<br />
function, but it is not possible with the error messages from KDb.</p>

<p>What i ended doing for these messages is to replace the placeholders<br />
with themselves, so that KI18n does not warn about missing arguments but<br />
the translated string sill has them and can call .arg() with KDb’s<br />
HTML-formatted error messages.</p>

<p>FIXED-IN:3.2.1</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R71 Kexi</div></div></div><br /><div><strong>BRANCH</strong><div><div>i18n-errors (branched from 3.2)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D29804">https://phabricator.kde.org/D29804</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/migration/importwizard.cpp</div></div></div><br /><div><strong>To: </strong>jfita, staniek, piggz<br /><strong>Cc: </strong>Kexi-Devel-list, barman, staniek<br /></div>