Bug 132932 - Strings that need pluralization via ngettext
Summary: Strings that need pluralization via ngettext
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: lowest enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on: 133750
Blocks:
  Show dependency treegraph
 
Reported: 2020-05-10 20:48 UTC by Adolfo Jayme Barrientos
Modified: 2023-06-29 18:26 UTC (History)
1 user (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 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