Fix KCatalog::translate when translation is same as original text
ClosedPublic

Authored by aacid on Jul 29 2018, 9:16 PM.

Details

Summary

We need to be compare the pointer passed to gettext with the one we get
back.

If it is the same it means no translation was found, if it
is different then it means the translation was found.

Test Plan

Test now succeeds, without patch it fails

Diff Detail

Repository
R249 KI18n
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
aacid created this revision.Jul 29 2018, 9:16 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptJul 29 2018, 9:16 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
aacid requested review of this revision.Jul 29 2018, 9:16 PM
ilic accepted this revision.Jul 30 2018, 7:34 AM
ilic added a subscriber: ilic.

I distinctly remember having had the same quandry once, and then someone from the gettext side said to compare pointers. Even the comment to dngettext call in the plural version of KCatalog::translate mentions comparison of pointers to this effect. So, "someone" simply screwed up on porting from kdelibs4, when replacing char*'s with QByteArray's...

This revision is now accepted and ready to land.Jul 30 2018, 7:34 AM
This revision was automatically updated to reflect the committed changes.