Diffusion Kexi ecb7c8fa6c98

Fix KI18n’s (I18N_ARGUMENT_MISSING) warnings in migration

Authored by jfita on May 17 2020, 8:00 AM.

Description

Fix KI18n’s (I18N_ARGUMENT_MISSING) warnings in migration

Summary:
If there is any error during a migration, Kexi gets the error message
already formatted in HTML from KDb and tries to mix this error message
with a markup-aware KLocalizedString. However, KI18n escapes all QString
arguments and the user sees the HTML tags in the error message.
Therefore, it left out the replacement of placeholders until it got the
translated QString, avoiding the escaping.

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

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

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

FIXED-IN:3.2.1

Reviewers: staniek, piggz

Reviewed By: staniek

Subscribers: Kexi-Devel-list

Tags: KEXI

Differential Revision: https://phabricator.kde.org/D29804

Details

Committed
staniekMay 17 2020, 8:04 AM
Reviewer
staniek
Differential Revision
D29804: Fix KI18n’s (I18N_ARGUMENT_MISSING) warnings in migration
Parents
R71:869b20b73da8: Select design or text view mode for new items
Branches
Unknown
Tags
Unknown