Invalid pluralisation for German translation of x_pages #3456

Closed
opened 2026-02-05 06:46:24 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @knuz92 on GitHub (Jan 16, 2023).

Originally assigned to: @ssddanbrown on GitHub.

Describe the Bug

For chapters, the number of pages is displayed below. In the German version, the word "Seite" (page) is always displayed here and not "Seiten" (pages) if there are more than one.

Steps to Reproduce

Go to a book with chapters in it.

Expected Behaviour

the plural of "Seite" (page) is "Seiten" (pages)

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

BookStack v22.11.1

PHP Version

8.1

Hosting Environment

Debian 11

Originally created by @knuz92 on GitHub (Jan 16, 2023). Originally assigned to: @ssddanbrown on GitHub. ### Describe the Bug For chapters, the number of pages is displayed below. In the German version, the word "Seite" (page) is always displayed here and not "Seiten" (pages) if there are more than one. ### Steps to Reproduce Go to a book with chapters in it. ### Expected Behaviour the plural of "Seite" (page) is "Seiten" (pages) ### Screenshots or Additional Context _No response_ ### Browser Details _No response_ ### Exact BookStack Version BookStack v22.11.1 ### PHP Version 8.1 ### Hosting Environment Debian 11
OVERLORD added the 🐛 Bug label 2026-02-05 06:46:24 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jan 16, 2023):

Hi @knuz92,
Just tested on my instance:

Screenshot 2023-01-16 at 12 06 24

This seems to be correct?
Doesn't look like the translation has recently changed or anything, has been the same for the last 3 years.
Seems to be the same translation used in the sidebar.
Are you specifically looking at a different part of the interface? Or that shown in my screenshot?

@ssddanbrown commented on GitHub (Jan 16, 2023): Hi @knuz92, Just tested on my instance: <img width="512" alt="Screenshot 2023-01-16 at 12 06 24" src="https://user-images.githubusercontent.com/8343178/212674645-10fe0fe2-e011-47ee-9717-f16ef151a65c.png"> This seems to be correct? Doesn't look like the translation has recently changed or anything, has been the same for the last 3 years. Seems to be the same translation used in the sidebar. Are you specifically looking at a different part of the interface? Or that shown in my screenshot?
Author
Owner

@knuz92 commented on GitHub (Jan 16, 2023):

In your screenshot its correct, here you can see it live on my instance: https://rdmed.n.roteskreuz.at/books/test

Bildschirm­foto 2023-01-16 um 13 18 52

@knuz92 commented on GitHub (Jan 16, 2023): In your screenshot its correct, here you can see it live on my instance: https://rdmed.n.roteskreuz.at/books/test ![Bildschirm­foto 2023-01-16 um 13 18 52](https://user-images.githubusercontent.com/10095962/212676619-a3220ee8-66d4-4982-9853-61e7783d3adc.png)
Author
Owner

@knuz92 commented on GitHub (Jan 16, 2023):

thats interesting - if you are not logged in, you get "Seiten" if i'm logged in i get "Seite" as in my Screenshot.

@knuz92 commented on GitHub (Jan 16, 2023): thats interesting - if you are not logged in, you get "Seiten" if i'm logged in i get "Seite" as in my Screenshot.
Author
Owner

@knuz92 commented on GitHub (Jan 16, 2023):

Bildschirm­foto 2023-01-16 um 13 21 59

It appears only on "Deutsch (Du)"

@knuz92 commented on GitHub (Jan 16, 2023): ![Bildschirm­foto 2023-01-16 um 13 21 59](https://user-images.githubusercontent.com/10095962/212677142-5d648e27-0880-4ec7-958b-177978806c78.png) It appears only on "Deutsch (Du)"
Author
Owner

@ssddanbrown commented on GitHub (Jan 16, 2023):

Thanks for the further investigation and information.

Can confirm this issue.
Tracing down how pluralisation works, we find this function is used to get the translation index:

d3ff07dbb3/src/Illuminate/Translation/MessageSelector.php (L110)

Since the informal German language has a somewhat custom local code in BookStack (de_informal) it does not match the list of hardcoded locales. Think we'll need to extend the MessageSelector here to match just against the first part of the locale, or add a specific case for de_informal.

@ssddanbrown commented on GitHub (Jan 16, 2023): Thanks for the further investigation and information. Can confirm this issue. Tracing down how pluralisation works, we find this function is used to get the translation index: https://github.com/laravel/framework/blob/d3ff07dbb343b7aaaef2cc623cc32516d8551a68/src/Illuminate/Translation/MessageSelector.php#L110 Since the informal German language has a somewhat custom local code in BookStack (`de_informal`) it does not match the list of hardcoded locales. Think we'll need to extend the `MessageSelector` here to match just against the first part of the locale, or add a specific case for `de_informal`.
Author
Owner

@ssddanbrown commented on GitHub (Jan 16, 2023):

This has now been addressed within 6070d804f8, with a test to cover, and will be part of the next feature release.

Thanks again @knuz92 for reporting.

@ssddanbrown commented on GitHub (Jan 16, 2023): This has now been addressed within 6070d804f8ac331c66dd689d8f55ba8a08fb8cf9, with a test to cover, and will be part of the next feature release. Thanks again @knuz92 for reporting.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3456