Bug 83128 - UI: In "1 columns selected" the singular should be used
Summary: UI: In "1 columns selected" the singular should be used
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: Other All
: low minor
Assignee: Not Assigned
URL:
Whiteboard: target:6.2.0
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-27 07:30 UTC by Robert Pollak
Modified: 2020-05-17 06:55 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Pollak 2014-08-27 07:30:11 UTC
The status bar states, how many lines and columns are selected. It should use singular, if it's only one line or column.

I am observing this in the German GUI localization, where it should be "1 Spalte" instead of "1 Spalten".
Comment 1 Adolfo Jayme Barrientos 2014-09-01 20:56:30 UTC
Thank you for your bug report.

Yeah, it happens in English as well because that message doesn’t support plural forms.
Comment 2 QA Administrators 2015-09-04 02:49:40 UTC Comment hidden (obsolete)
Comment 3 Robert Pollak 2015-09-04 17:57:45 UTC
I can only test on LibreOffice 4.4.3.2, since that's what the package manager of my Linux distro provides. There this Calc bug is still present.
Comment 4 Julien Nabet 2016-09-16 18:13:01 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

Code pointer:
http://opengrok.libreoffice.org/xref/core/sc/source/ui/view/cellsh.cxx#746
But then I don't know how it could be fixed.
Comment 5 Xisco Faulí 2017-09-29 08:53:19 UTC Comment hidden (obsolete)
Comment 6 Robert Pollak 2017-09-30 16:46:36 UTC
This is still present in 5.4.1.2 on Windows 7.
Comment 7 QA Administrators 2018-10-01 02:52:18 UTC Comment hidden (obsolete)
Comment 8 Robert Pollak 2018-10-02 21:13:26 UTC
This is still present in 6.0.6.2 on Linux Mint 19.
Comment 9 Julien Nabet 2018-10-03 06:31:09 UTC
I suppose it's https://opengrok.libreoffice.org/xref/core/sc/inc/globstr.hrc#158

Heiko/Xisco: any idea how to deal with this kind of issue? (eg should we put "column(s)"?)
Comment 10 Xisco Faulí 2018-10-03 13:57:54 UTC
not really, I see the same behaviour in writer when only 1 word is written.
I'm wondering if there's already any place where we do this distinction...
Comment 11 Heiko Tietze 2018-10-04 15:18:10 UTC
The solution is called ngettext() [1] and returns plural forms from localization depending on the locale setting, e.g. 0/1/>1 for French or 1/<>1 for English.

Caolan, was/is it planned to extend the localization?

[1] https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html
Comment 12 Caolán McNamara 2018-10-05 14:47:23 UTC
That particular string is tricky as there are two orthogonal places in that one string where singular vs plural is used, I mean it says "X rows, Y columns" not just "X rows" or "Y columns", so its difficult as an example of a simple case to begin with.

Lets take a simpler one instead, typing apple in calc just once and then searching for apple will result in a dialog saying "1 results found"
Comment 13 Caolán McNamara 2018-10-05 15:11:08 UTC
https://gerrit.libreoffice.org/#/c/61426/ is my proposal to support the typical ngettext style usage, some details sent to the dev and l10n lists
Comment 14 Commit Notification 2018-10-09 07:53:35 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=283229f5bc27ce23456b9cbd9aff75ff44707105

Related: tdf#83128 support translation of plural forms

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 15 Xisco Faulí 2018-11-09 15:31:52 UTC
A polite ping to Caolán McNamara:
Is this bug fixed? if so, could you please close it as RESOLVED FIXED ? Otherwise, Could you please explain what's missing?
Thanks
Comment 16 Caolán McNamara 2018-11-09 16:25:22 UTC
I added support for n_gettext plurals, which is an improvement over the past, but can only handle one singlular/plural in the string, which isn't the case for string mentioned in the original report. The only solution is to split the string up into separately translatable components.

Lets rearrange that and see how it scans.
Comment 17 Commit Notification 2018-11-11 19:30:04 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/960f9045568317399b0dae4fd059a41566d8d3e9%5E%21

Resolves: tdf#83128 translate row/col counts as separate n_gettext args

It will be available in 6.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 18 Commit Notification 2018-11-16 13:52:43 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/41d588835c359171c8d1a410221d75b9410b0c2d%5E%21

Related: tdf#83128 translate word/char counts as separate n_gettext args

It will be available in 6.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.