Bug 370940 - DPI field shows: 300 DPI (I18N_EXCESS_ARGUMENTS_SUPPLIED)
Summary: DPI field shows: 300 DPI (I18N_EXCESS_ARGUMENTS_SUPPLIED)
Status: RESOLVED FIXED
Alias: None
Product: libksane
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Pino Toscano
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-16 07:56 UTC by Heinrich Schuchardt
Modified: 2020-07-08 21:04 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.07.80


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heinrich Schuchardt 2016-10-16 07:56:52 UTC
Dear Maintainer,

I am using Debian Stretch package skanlite (2.0-1).

With a Canon CanoScan N670U the field "Scan resolution" shows the text
"300 DPI (I18N_EXCESS_ARGUMENTS_SUPPLIED)".

This indicates that the i18n library is not called correctly.

Best regards

Heinrich Schuchardt

Reproducible: Always

Steps to Reproduce:
Open the application and choose a scanner.

Actual Results:  
With a Canon CanoScan N670U the field "Scan resolution" shows the text
"300 DPI (I18N_EXCESS_ARGUMENTS_SUPPLIED)".

Expected Results:  
The text should read "300 DPI".
Comment 1 Heinrich Schuchardt 2016-10-16 08:34:13 UTC
The command line shows this output:
"1 instead of 0 arguments to message { DPI} supplied before conversion."
Comment 2 John Scott 2019-07-24 01:58:49 UTC
I think #386053 might be related
Comment 3 mirh 2020-03-26 20:35:08 UTC
Still a thing in latest git.
Comment 4 Pino Toscano 2020-07-06 17:17:20 UTC
Git commit dd39e1fb2f2da6d4f2d8b70366441dc0044117fb by Pino Toscano.
Committed on 06/07/2020 at 17:10.
Pushed by pino into branch 'master'.

i18n: add placeholder to KSaneOption::unitString() strings

The resulting string is set as suffix for KPluralHandlingSpinBox.
KPluralHandlingSpinBox updates its text on value change replacing the
value as placeholder/argument in the suffix string; if the
KLocalizedString suffix does not have a placeholder, there will be a
command line warning about the extra placeholder.
FIXED-IN: 20.07.80

M  +6    -6    src/options/ksaneoption.cpp

https://invent.kde.org/graphics/libksane/commit/dd39e1fb2f2da6d4f2d8b70366441dc0044117fb
Comment 5 Pino Toscano 2020-07-06 21:43:16 UTC
Sorry, I just realized the change in libksane is wrong: the result is that the value will be shown twice, once by the spin box itself and the other as its suffix.

Instead, I will fix KPluralHandlingSpinBox to not attempt to substitute the value in the suffix KLocalizedString.
Comment 6 Pino Toscano 2020-07-06 21:58:11 UTC
Actually I take it back: the issue is in libkscan: the KLocalizedString object for KPluralHandlingSpinBox::setSuffix() must be a plural string.
Comment 7 Pino Toscano 2020-07-06 22:07:09 UTC
Git commit f88f843d5e143b4b5b89119189d720d616c01cbe by Pino Toscano.
Committed on 06/07/2020 at 22:04.
Pushed by pino into branch 'master'.

i18n: use plural forms for KSaneOption::unitString() strings

The resulting string is set as suffix for KPluralHandlingSpinBox.
KPluralHandlingSpinBox tries to substitute the value, so the
KLocalizedString set must be either a plural form.

Hence, make all the strings returned by KSaneOption::unitString()
as plural forms.
FIXED-IN: 20.07.80

M  +4    -4    src/options/ksaneoption.cpp

https://invent.kde.org/graphics/libksane/commit/f88f843d5e143b4b5b89119189d720d616c01cbe
Comment 8 Michael 2020-07-08 21:04:44 UTC
Awesome! I was just about to file this as a bug and have the exact same issue with the exact same scanner :)