finish up ability to switch languages without function collision
This commit is contained in:
parent
c63adcfae0
commit
030e1e82c3
2 changed files with 13 additions and 2 deletions
2
boot.php
2
boot.php
|
@ -7,7 +7,7 @@ require_once('include/text.php');
|
||||||
require_once("include/pgettext.php");
|
require_once("include/pgettext.php");
|
||||||
|
|
||||||
|
|
||||||
define ( 'FRIENDIKA_VERSION', '2.3.1110' );
|
define ( 'FRIENDIKA_VERSION', '2.3.1111' );
|
||||||
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
|
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
|
||||||
define ( 'DB_UPDATE_VERSION', 1091 );
|
define ( 'DB_UPDATE_VERSION', 1091 );
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,8 @@ function tt($singular, $plural, $count){
|
||||||
if(x($a->strings,$singular)) {
|
if(x($a->strings,$singular)) {
|
||||||
$t = $a->strings[$singular];
|
$t = $a->strings[$singular];
|
||||||
$f = 'string_plural_select_' . str_replace('-','_',$lang);
|
$f = 'string_plural_select_' . str_replace('-','_',$lang);
|
||||||
|
if(! function_exists($f))
|
||||||
|
$f = 'string_plural_select_default';
|
||||||
$k = $f($count);
|
$k = $f($count);
|
||||||
return is_array($t)?$t[$k]:$t;
|
return is_array($t)?$t[$k]:$t;
|
||||||
}
|
}
|
||||||
|
@ -129,3 +131,12 @@ function tt($singular, $plural, $count){
|
||||||
return $singular;
|
return $singular;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue