Bug 126834 - Wrong wordcount plural rule used for hsb and dsb
Summary: Wrong wordcount plural rule used for hsb and dsb
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Localization (show other bugs)
Version:
(earliest affected)
6.3.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-11 19:09 UTC by milupo
Modified: 2020-04-15 17:10 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot wrong plural form hsb in Writer word count (17.85 KB, image/png)
2019-08-11 19:09 UTC, milupo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description milupo 2019-08-11 19:09:08 UTC
Created attachment 153304 [details]
Screenshot wrong plural form hsb in Writer word count

Hi,

there is a bug in Upper Sorbian and Lower Sorbian Writer. In status bar, the wordcount is displayed. But, in Upper Sorbian and Lower Sorbian Writer the wrong plural rule is used, probably the English plural rule instead of the Sorbian rules. Both Sorbian languages have 4 plural forms, singular, dual, plural nominitive and plural genitive.

Here are the forms for the word "character" in Upper Sorbian and Lower Sorbian:

Upper Sorbian:

1, 101, 201, etc. znamješko
2, 102, 202, etc. znamješce
3, 103, 203, etc. - 4. 104, 204, etc. znamješka
5 - 100, 105 - 200, 205 - 300. etc. znamješkow

The Lower Sorbian words are znamuško, znamušce, znamuška, znamuškow.

LibreOffice uses 2 forms only, the singular form znamješko/znamuško and the dual form znamješce/znamušce. Please fix this.

Please find attached a screenshot of Upper Sorbian Writer. In the screenshot, the word has 9 characters and the Sorbian form znamješkow should be used. But, it is used znamješce instead. That's wrong.

Thanks
Comment 1 milupo 2019-08-11 20:18:50 UTC
In addition to this, the last form znamješkow/znamuškow is used for 0 as well. With decimals, the last digit rules the plural form.
Comment 2 milupo 2019-10-09 11:24:23 UTC
Hi, 

I'm already waiting for 2 months for a reply to this bug. Please try fix this bug. 

Thanks.
Comment 3 Xisco Faulí 2019-10-14 15:24:51 UTC
@Eike, I thought you might be interested in this issue...
Comment 4 Eike Rathke 2019-10-15 21:29:25 UTC
Not my construction site.

The resource strings to be translated are only singular and plural cases and combinations thereof, I guess likely the code doesn't handle anything else.
See https://opengrok.libreoffice.org/xref/core/sw/inc/strings.hrc?r=ed200d9f#293
Comment 5 Julien Nabet 2019-10-23 19:28:48 UTC
Xisco: I can change a translation on Weblate but I don't know how to add some translations so can't help here.
Comment 6 milupo 2019-10-23 20:00:36 UTC
(In reply to Julien Nabet from comment #5)
> Xisco: I can change a translation on Weblate but I don't know how to add
> some translations so can't help here.

Hi Julien,

I don't know what you want to translate. The strings have been already translated, with the correct plural forms. It is about following strings:

https://weblate.documentfoundation.org/translate/libo_ui-master/swmessages/hsb/?type=all&offset=375

https://weblate.documentfoundation.org/translate/libo_ui-master/swmessages/hsb/?type=all&offset=376

https://weblate.documentfoundation.org/translate/libo_ui-master/swmessages/hsb/?type=all&offset=378

https://weblate.documentfoundation.org/translate/libo_ui-master/swmessages/hsb/?type=all&offset=379

Even the plural equation is shown with each of these strings.

this s for Upper Sorbian. The same applies to Lower Sorbian.
Comment 7 Julien Nabet 2019-10-23 21:01:52 UTC
(In reply to milupo from comment #6)
> (In reply to Julien Nabet from comment #5)
> > Xisco: I can change a translation on Weblate but I don't know how to add
> > some translations so can't help here.
> 
> Hi Julien,
> 
> I don't know what you want to translate. The strings have been already
> translated, with the correct plural forms. It is about following strings:
> ...
So if everything is ok on Weblate, I don't know how I can help since it doesn't seem trivial -> uncc myself
Comment 8 milupo 2019-10-23 22:26:08 UTC
The Sorbian plural rules are not correctly applied. Obviously, only 2 of the 4 Sorbian forms are used, singular and plural. That's the English rule.
Comment 9 Liaison to zh-CN User Community 2019-10-24 00:02:45 UTC
(In reply to milupo from comment #8)
> The Sorbian plural rules are not correctly applied. Obviously, only 2 of the
> 4 Sorbian forms are used, singular and plural. That's the English rule.
The thing is, the English rule is also the plurality rule for a lot of other languages.  Sorbian is unique/special in the sense that very few languages share its rule of four singular/plural forms.

The LibreOffice code most likely doesn't know how to handle 4-form nouns yet, that's what Julien meant by "doesn't seem trivial".
Comment 10 Liaison to zh-CN User Community 2019-10-24 00:14:02 UTC
Looking at https://opengrok.libreoffice.org/xref/core/sw/inc/strings.hrc?r=0c1ab11c#296 it seems to me LO indeed assumes that "word" has at most two plurality forms for all languages.  So not trivial indeed.
Comment 11 Xisco Faulí 2019-10-24 08:52:41 UTC Comment hidden (obsolete)
Comment 12 milupo 2019-10-24 09:45:36 UTC
(In reply to zh_CN User Community Liaison from comment #9)

> 
> The LibreOffice code most likely doesn't know how to handle 4-form nouns
> yet, that's what Julien meant by "doesn't seem trivial".

That's not true. Slovenian has a similar plural rule with 4 forms and for Slovenian the rule works here. So, this bug is not a problem for LibreOffice, it is simply a bug which can be fixed.
Comment 13 Liaison to zh-CN User Community 2019-10-24 14:27:27 UTC
(In reply to milupo from comment #12)
> (In reply to zh_CN User Community Liaison from comment #9)
> 
> > The LibreOffice code most likely doesn't know how to handle 4-form nouns
> > yet, that's what Julien meant by "doesn't seem trivial".
> 
> That's not true. Slovenian has a similar plural rule with 4 forms and for
> Slovenian the rule works here. So, this bug is not a problem for
> LibreOffice, it is simply a bug which can be fixed.
I stand corrected.

Comparing the Slovenian PO file
https://opengrok.libreoffice.org/xref/translations/source/sl/sw/messages.po?r=4960b59e#1916
and the Upper Sorbian one
https://opengrok.libreoffice.org/xref/translations/source/hsb/sw/messages.po?r=708eb821#2290
the format of the translations seem identical to me.

The "Plural-Forms:" line are slightly different but both seem legit.

Someone with more expertise in gettext than I is needed here.
Comment 14 Liaison to zh-CN User Community 2019-10-24 14:53:05 UTC
I think I have some more findings to share.

The Upper Sorbian PO file on libreoffice-6-3-3 branch (and I assume libreoffice-6-3 branch as well) doesn't have a proper "Plural-Forms:" line:
https://gerrit.libreoffice.org/plugins/gitiles/translations/+/libreoffice-6-3-3/source/hsb/sw/messages.po

@milupo: What is the LibreOffice verion of your screenshot?  If it's 6.3.x, can you test with master?

I guess perhaps the 6.3 branches still use Pootle and Pootle doesn't support 4-form nouns?
Comment 15 milupo 2019-10-24 17:26:27 UTC
I have LO 6.3.3.1 and the issue still exists.
Comment 16 milupo 2019-10-24 18:02:43 UTC
I've just installed LO 6.3.3.2 and the issue still exists, too.
Comment 17 Liaison to zh-CN User Community 2019-10-24 18:27:34 UTC
(In reply to milupo from comment #16)
> I've just installed LO 6.3.3.2 and the issue still exists, too.
By "test with master", I mean testing one of those daily builds for master branch:
https://wiki.documentfoundation.org/QA/Testing_Daily_Builds
or maybe the recently released 6.4.0 alpha1:
https://www.libreoffice.org/download/download/?version=6.4.0
This bug should be fixed there.

Testing 6.3.3.1 and 6.3.3.2 are not particulary useful since your initial report was against 6.3.0 release.
Comment 18 milupo 2019-10-24 18:34:56 UTC
> By "test with master", I mean testing one of those daily builds for master
> branch:
> https://wiki.documentfoundation.org/QA/Testing_Daily_Builds
> or maybe the recently released 6.4.0 alpha1:
> https://www.libreoffice.org/download/download/?version=6.4.0
> This bug should be fixed there.
> 

Hm, AFAIK Daily builds contain English only. But I will test.
Comment 19 Liaison to zh-CN User Community 2019-10-24 18:44:11 UTC
(In reply to milupo from comment #18)
> Hm, AFAIK Daily builds contain English only
That's probably right, I've never used them myself.

But 6.4.0 alpha1 definitely has all the languages, so please start with that one.
Comment 20 milupo 2019-10-24 19:28:52 UTC
Hi,

the bug is fixed, both for hsb and dsb. You can mark it as resolved.

Thank you to all for their help.
Comment 21 Xisco Faulí 2019-10-24 20:09:57 UTC
(In reply to milupo from comment #20)
> Hi,
> 
> the bug is fixed, both for hsb and dsb. You can mark it as resolved.
> 
> Thank you to all for their help.

Hello,
Could you please share the link where it got fixed ?
Comment 22 milupo 2019-10-24 20:30:58 UTC
Hi Xisco,

I wanted to download it from the Preleases directory but the download time was very low when I wanted to do that. Therefore I downloaded it from the Testing directory:

http://download.documentfoundation.org/libreoffice/testing/6.4.0/win/x86_64/

I tested Win x86_64 only.
Comment 23 Julien Nabet 2020-04-14 09:46:26 UTC
Just re reading all this, it seems ok from 6.4.0
6.4.2 can be downloaded from https://www.libreoffice.org/download/download/

Let's put this one to WFM then.

milupo: don't hesitate to reopen this tracker if you still reproduce this.
Comment 24 milupo 2020-04-14 11:05:53 UTC
Hi Julien, yes, the issue is resolved since 6.4.0, see my comment #20. I currently use version 6.4.3.1 and all is OK.
Comment 25 Liaison to zh-CN User Community 2020-04-15 17:10:17 UTC
(In reply to Xisco Faulí from comment #21)
> (In reply to milupo from comment #20)
> > Hi,
> > 
> > the bug is fixed, both for hsb and dsb. You can mark it as resolved.
> > 
> > Thank you to all for their help.
> 
> Hello,
> Could you please share the link where it got fixed ?
@Xisco, I assume you were asking this because you want to point at a commit/change that fixes this bug.

As far as I understand, this bug was fixed not because of a specific code change, but because of the transition from Pootle to Weblate by the l10n team, which happened between 6-3 branch and 6-4 branch.

The old Pootle platform and workflow doesn't put the needed correct "Plural-Forms:" field in the PO files.  The Slovenian team had to avoid Pootle and directly commit to git repo before this transition.

Just FYI.