D18769: Fix context for QDateTime::toString() translations

Elvis Angelaccio noreply at phabricator.kde.org
Sun Feb 17 10:45:04 GMT 2019


elvisangelaccio added a comment.


  In D18769#413805 <https://phabricator.kde.org/D18769#413805>, @aacid wrote:
  
  > I didn't realize you moved the text out of the i18n call.
  >
  > If you do that gettext won't extract it and thus it'll be untranslatable.
  >
  > I see that you did that so you can reuse it untranslated later.
  >
  > Maybe this would work (haven't tried it)?
  >
  >   KLocalizedString s = ki18nc(context, text);
  >   const QString translatedFormat = s.toString();
  >   if (translatedFormat.count(QLatin1Char('\'')) == 2) { /* good */ }
  >   else { qCWarning();      newGroupValue = s.toString({"en"}); }
  >   
  >
  > i think that would mean "no" translation in the else since it is asking for an en translation.
  
  
  Ah sorry, didn't know that. I'll try.

REPOSITORY
  R318 Dolphin

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

To: elvisangelaccio, lueck, aacid, cfeck
Cc: ltoscano, kfm-devel, alexde, feverfew, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190217/feff27d7/attachment.htm>


More information about the kfm-devel mailing list