X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fpgettext.php;h=83e76ba9d60b9b1c0d05254a53b3647fb64090bc;hb=6d7781434bedda23366e6c007c15f85b80a0e073;hp=c7fc5869825ef57cca19fd3b75e3ef660acbd660;hpb=c63adcfae061809ce25217207f638b1e6c1d1bee;p=friendica.git diff --git a/include/pgettext.php b/include/pgettext.php index c7fc586982..83e76ba9d6 100644 --- a/include/pgettext.php +++ b/include/pgettext.php @@ -119,6 +119,8 @@ function tt($singular, $plural, $count){ if(x($a->strings,$singular)) { $t = $a->strings[$singular]; $f = 'string_plural_select_' . str_replace('-','_',$lang); + if(! function_exists($f)) + $f = 'string_plural_select_default'; $k = $f($count); return is_array($t)?$t[$k]:$t; } @@ -128,4 +130,13 @@ function tt($singular, $plural, $count){ } else { return $singular; } -}} \ No newline at end of file +}} + +// provide a fallback which will not collide with +// a function defined in any language file + +if(! function_exists('string_plural_select_default')) { +function string_plural_select_default($n) { + return ($n != 1); +}} +