]> git.mxchange.org Git - friendica.git/commitdiff
finish up ability to switch languages without function collision
authorFriendika <info@friendika.com>
Wed, 21 Sep 2011 22:37:16 +0000 (15:37 -0700)
committerFriendika <info@friendika.com>
Wed, 21 Sep 2011 22:37:16 +0000 (15:37 -0700)
boot.php
include/pgettext.php

index 61384a4276f72fdf5a5dd5ec153dc791b7f6977b..d068122eda9d4f8f0faf0e0aa01a40c6abdfe099 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -7,7 +7,7 @@ require_once('include/text.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 ( 'DB_UPDATE_VERSION',      1091      );
 
index c7fc5869825ef57cca19fd3b75e3ef660acbd660..83e76ba9d60b9b1c0d05254a53b3647fb64090bc 100644 (file)
@@ -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);
+}}
+