D24884: I18N_NOOP2 was deprecated but we can't replace by I18NC_NOOP as it expends it as 2 elements (context + text)

David Faure noreply at phabricator.kde.org
Sat Nov 23 13:22:08 GMT 2019


dfaure added a comment.


  I don't exactly mind if we resurrect NOOP2 or rename it to STRIP, but STRIP kind of makes sense because the name explicitly says something is being stripped (and the documentation should warn loudly about the risks of doing that). It's a better name than "2" where the "2" means nothing else than "oops I can't overload macros".
  
  I didn't realize one solution was to store a KLocalizedString, but that wouldn't work for KFilePlacesItem anyway, it uses KBookmark as storage (which takes a QString and can't be changed, it makes sense for it to be a QString, for actual user bookmarks).
  
  I agree that the risk here is typos. The documentation should warn about that. But it's a logical risk when having a number of I18N markers (all of which have to repeat the context anyway), and then *one* call to i18nc for all of them (where repeating the context is IMHO an acceptable tradeoff for the complexity of storing the context in each string, when the underlying storage doesn't allow it).

INLINE COMMENTS

> klocalizedstring.h:69
>   *
> - * \deprecated Since 5.0, use \c I18NC_NOOP.
> + * \deprecated Since 5.0, use \c I18NC_NOOP_TRIP.
>   */

typo: *S*TRIP

REPOSITORY
  R249 KI18n

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

To: mlaurent, dfaure, ilic
Cc: kossebau, aacid, vkrause, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191123/f395d0f4/attachment.html>


More information about the Kde-frameworks-devel mailing list