Bug 372681

Summary: Message with plural forms is not translated if only translation of plural form differs from msgid
Product: [Frameworks and Libraries] frameworks-ki18n Reporter: Lasse Liehu <lasse.liehu>
Component: generalAssignee: Chusslove Illich <caslav.ilic>
Status: RESOLVED FIXED    
Severity: normal CC: kdelibs-bugs-null
Priority: NOR    
Version First Reported In: 5.28.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Lasse Liehu 2016-11-19 23:56:44 UTC
The following string from Finnish screenlocker_kcm.po is not translated (msgid_plural is shown in the UI):
#. +> trunk5 stable5
#: kcm.cpp:55
msgctxt "Spinbox suffix. Short for minutes"
msgid " min"
msgid_plural " mins"
msgstr[0] " min"
msgstr[1] " min"

In this case msgstr[0] equals msgid but msgstr[1] differs from msgid_plural. If msgstr[0] is changed to not equal msgid then the string is translated.
Comment 1 Chusslove Illich 2016-11-20 22:33:45 UTC
Git commit a7d5f88c144b51932859b9d3a74a21feca69fd10 by Chusslove Illich (Часлав Илић).
Committed on 20/11/2016 at 22:31.
Pushed by ilic into branch 'master'.

Check properly pointer inequality from dngettext

If original and translation are same, dngettext will return
the original pointer, which is generally fine, except in
the corner cases where e.g. msgstr[1] is same as msgid.
Therefore check for pointer difference only with msgid or
only with msgid_plural, and not with both.

M  +7    -2    src/kcatalog.cpp

http://commits.kde.org/ki18n/a7d5f88c144b51932859b9d3a74a21feca69fd10