1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-07 15:26:54 +02:00
This commit is contained in:
Ryan Cramer
2023-07-10 09:33:27 -04:00
parent e0239d0381
commit 3b0462271d

View File

@@ -285,12 +285,11 @@ function _x($text, $context, $textdomain = null) {
*/
function _n($textSingular, $textPlural, $count, $textdomain = null) {
$count = (int) $count;
$value = $count === 1 ? __($textSingular, $textdomain) : __($textPlural, $textdomain);
if($count === 0 && $value !== $textPlural && wire()->languages) {
if($count === 0 && wire()->languages) {
$plural = __('0-plural', 'common');
if(strtolower($plural) === '0-singular') {
$value = __($textSingular, $textdomain);
}
$value = strtolower($plural) === '0-singular' ? __($textSingular, $textdomain) : __($textPlural, $textdomain);
} else {
$value = $count === 1 ? __($textSingular, $textdomain) : __($textPlural, $textdomain);
}
return $value;
}