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
Mon Oct 28 20:26:49 GMT 2019


dfaure added a comment.


  I agree with Friederich. In kio/filewidgets/kfileplacesmodel.cpp (for which you accepted the change in D24970 <https://phabricator.kde.org/D24970>) I'm passing the context to the method because I18NC_NOOP forces me to, but then I'm *discarding* this context because:
  
  1. I have nowhere to store it
  2. I don't need to store it, it's the same for every item --- just like in Friederich's example.
  
  Why store duplicated and redundant data?
  
  So if I had a STRIP version that would all be much simpler.
  
  One has to be careful anyway when using I18N_NOOP, to actually call i18n on those strings, and to never call i18n on a variable whose contents wasn't marked with I18N_NOOP. The API can't be foolproof against that. So I don't see why it's trying to be foolproof against the context being provided externally, at the expense of more complicated code for no purpose.

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/20191028/3ce7f32c/attachment.html>


More information about the Kde-frameworks-devel mailing list