• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Plural forms error

Wink

Chevereto Member
lib\G\classes\class.gettext.php

PHP:
    private function parsePluralData($header)
    {
...
            $nplurals = (int) $matches[1];
            if (preg_match('/^([!n\=\<\>\&\|\?\:%\s\(\)\d]+)$/', $matches[2]) === true) {
                $formula = $matches[2];
            }
...
    }

MUST be
PHP:
            if (preg_match('/^([!n\=\<\>\&\|\?\:%\s\(\)\d]+)$/', $matches[2])) {
                $formula = $matches[2];
            }

...because preg_match return only 0, 1 or false, but never true

Because of this error, all plural forms do not work at all for all languages with more then 2 plural forms.
 
Thank you, you are right. Thanks for pointing out.

This will get patched in V3.20.20 and V4.0.0.
 
Another problem with plurals in app\lib\classes\class.listing.php inside function getTabs()

PHP:
        $contents = [
            'images' => [
                'icon' => $listings['images']['icon'],
                'label' => _n('Image', 'Images', 2),
            ],
            'albums' => [
                'icon' => $listings['albums']['icon'],
                'label' => _n('Album', 'Albums', 2),
            ],
            'users' => [
                'icon' => $listings['users']['icon'],
                'label' => _n('User', 'Users', 2),
            ]
        ];

We need something like this
PHP:
        $contents = [
            'images' => [
                'icon' => $listings['images']['icon'],
                'label' => _s('Images'),
            ],
            'albums' => [
                'icon' => $listings['albums']['icon'],
                'label' => _s('Albums'),
            ],
            'users' => [
                'icon' => $listings['users']['icon'],
                'label' => _s('Users'),
            ]
        ];

Because it's not the same for some languages. For example in russian
"Albums" = "Альбомы" but "2 Albums" = "2 Альбома"
"Users" = "Пользователи" but "2 Users" = "2 Пользователя"
 
Back
Top