Bug 132932

Summary: Strings that need pluralization via ngettext
Product: LibreOffice Reporter: Adolfo Jayme Barrientos <fitojb>
Component: UIAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: enhancement CC: tuomas.hietala
Priority: lowest    
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=83128
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on: 133750    
Bug Blocks:    

Description Adolfo Jayme Barrientos 2020-05-10 20:48:27 UTC
The LibreOffice code base, due to historical reasons, has lots of quasi-duplicate translatable strings in its resources, whose only difference is the grammatical number; e.g. “rounded rectangle” / “rounded rectangles”. For l10n purposes, this is not optimal for the many languages that do not fit with English’s pluralization paradigm — for example, Arabic has up to six plural forms, Slavic languages have three, and even those languages with two plural forms do not exactly fit with English (like Portuguese, where “0 items” should be “0 ítem”, singular).

Until very recently, thanks to the work of Caolán, we are now able to use ngettext to support those languages whose pluralization has either fewer or more forms than English (two). ngettext deals with all the problems enumerated above, so LibreOffice should gradually be upgraded to use it. Multiple people can work on this as time permits.
Comment 1 Adolfo Jayme Barrientos 2020-05-10 20:49:08 UTC
First code pointer: https://git.libreoffice.org/core/+/master/include/svx/strings.hrc
Comment 2 Julien Nabet 2020-05-10 21:59:10 UTC
It could be interesting to have some examples of patches.
For example, I see this:
#define STR_ObjNameSingulNONE   NC_("STR_ObjNameSingulNONE", "Drawing object")
#define STR_ObjNamePluralNONE   NC_("STR_ObjNamePluralNONE", "Drawing objects")

First one is used in TakeObjNameSingul, the second in TakeObjNamePlural
in svx/source/svdraw/svdobj.cxx

Then what should I do for this case?
Comment 4 Julien Nabet 2020-05-17 07:44:51 UTC
Thank you Adolfo for the feedback.
3 commits quoted and 3 ways to do it.
Too complicate for me=>uncc myself.
Comment 5 Tuomas Hietala 2023-06-29 18:26:20 UTC
This could be an easyhack I guess?

A couple of cases here:
https://git.libreoffice.org/core/+/master/filter/inc/strings.hrc#41
https://git.libreoffice.org/core/+/master/filter/inc/strings.hrc#44