Skip to content

Commit

Permalink
small update for __n() required due to version upgrade of PHP-Gettext…
Browse files Browse the repository at this point in the history
… emulator
  • Loading branch information
browniebraun committed Mar 23, 2016
1 parent 641d147 commit 23bd9a8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions include/global_languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,15 @@ function __gettext($text, $domain = 'cacti') {
}else {
return $text;
}

}


function __n($single, $plural, $number, $domain = 'cacti') {
function __n($singular, $plural, $number, $domain = 'cacti'){
global $l10n;
return $l10n->_ngettext($single, $plural, $number);
if (isset($l10n[$domain])) {
return $l10n[$domain]->ngettext($singular, $plural, $number);
}else {
return ($number == 1) ? $singular : $plural;
}
}


Expand Down Expand Up @@ -308,8 +310,8 @@ function __gettext($text, $domain = 'cacti') {
return $text;
}

function __n($single, $plural, $number, $domain = 'cacti') {
return ($number == 1) ? $single : $plural;
function __n($singular, $plural, $number, $domain = 'cacti') {
return ($number == 1) ? $singular : $plural;
}

function __() {
Expand Down

0 comments on commit 23bd9a8

Please sign in to comment.