audiobookshelf icon indicating copy to clipboard operation
audiobookshelf copied to clipboard

[Enhancement]: Proper plurals support for localisation

Open biuklija opened this issue 4 months ago • 4 comments

Type of Enhancement

Web Interface/Frontend

Describe the Feature/Enhancement

Currently, some of the strings and labels for localisation are being reused in multiple locations without proper plurals support. While this works for English, problems arise in many inflected languages. Weblate has full support for these plural forms, so my suggestion is to separate labels/strings into "fixed" strings (meaning those that don't need plurals support) and "plural" strings require alternative translations in places where the translation depends on the number of items.

Why would this be helpful?

To take Croatian as an example, the string LabelBooks, if translated in the nominative case in Croatian (in plural) as "Knjige", would serve fine in the search results/search suggestions, e.g. here: vivaldi_oLWveEENnL However, the same word would be incorrect as a caption for the number of books available in a single library, where the translation is supposed to vary depending on the actual number of books. vivaldi_6cxm860taj Please note that in the above example with plurals the translation "knjiga/e" is my attempt to offer a correct translation for plurals of this word but some words have even more variants.

Future Implementation (Screenshot)

As per Weblate's documentation, we should have plural-supported strings. For example, the correct translation for the word "Book" in Croatian should be: 0, 1 knjiga 2, 3, 4 knjige 5-20 knjiga 21, 31... knjiga 22, 23, 24; 32, 33, 34... - knjige 25-30; 35-40... - knjiga

Audiobookshelf Server Version

v2.15.1

Current Implementation (Screenshot)

No response

biuklija avatar Oct 20 '24 17:10 biuklija