D29804: Fix KI18n’s (I18N_ARGUMENT_MISSING) warnings in migration

jordi fita i mas noreply at phabricator.kde.org
Sun May 17 00:49:35 BST 2020


jfita created this revision.
jfita added reviewers: staniek, piggz.
Herald added a project: KEXI.
Herald added a subscriber: Kexi-Devel-list.
jfita requested review of this revision.

REVISION 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

REPOSITORY
  R71 Kexi

BRANCH
  i18n-errors (branched from 3.2)

REVISION DETAIL
  https://phabricator.kde.org/D29804

AFFECTED FILES
  src/migration/importwizard.cpp

To: jfita, staniek, piggz
Cc: Kexi-Devel-list, barman, staniek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kexi-devel/attachments/20200516/28b70b01/attachment.htm>


More information about the Kexi-devel mailing list