X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=boot.php;h=aa40c17111a161571db4ecb88c8dd4e77b3261d9;hb=5034d7333eb849e9204d451a496f4fe2e019de62;hp=08caa72ab9ddb703da83d4d8d08eab5ac26d082e;hpb=3f432a7b82480dd985dbc2a67ae23cfc1ed258c6;p=friendica.git diff --git a/boot.php b/boot.php index 08caa72ab9..aa40c17111 100644 --- a/boot.php +++ b/boot.php @@ -2,7 +2,7 @@ set_time_limit(0); -define ( 'FRIENDIKA_VERSION', '2.1.920' ); +define ( 'FRIENDIKA_VERSION', '2.1.922' ); define ( 'DFRN_PROTOCOL_VERSION', '2.1' ); define ( 'DB_UPDATE_VERSION', 1043 ); @@ -159,6 +159,11 @@ if (get_magic_quotes_gpc()) { unset($process); } +/* + * translation system + */ +require_once("include/pgettext.php"); + /** * @@ -601,28 +606,6 @@ function replace_macros($s,$r) { }} -// load string translation table for alternate language - -if(! function_exists('load_translation_table')) { -function load_translation_table($lang) { - global $a; - - if(file_exists("view/$lang/strings.php")) - include("view/$lang/strings.php"); -}} - -// translate string if translation exists - -if(! function_exists('t')) { -function t($s) { - - $a = get_app(); - - if(x($a->strings,$s)) - return $a->strings[$s]; - return $s; -}} - // curl wrapper. If binary flag is true, return binary // results. @@ -1845,10 +1828,14 @@ if(! function_exists('format_like')) { function format_like($cnt,$arr,$type,$id) { $o = ''; if($cnt == 1) - $o .= $arr[0] . (($type === 'like') ? t(' likes this.') : t(' doesn\'t like this.')) . EOL ; + $o .= (($type === 'like') ? sprintf( t('%s likes this.'), $arr[0]) : sprintf( t('%s doesn\'t like this.'), $arr[0])) . EOL ; else { - $o .= '' - . $cnt . ' ' . t('people') . ' ' . (($type === 'like') ? t('like this.') : t('don\'t like this.')) . EOL ; + $spanatts = 'class="fakelink" onclick="openClose(\'' . $type . 'list-' . $id . '\');"'; + $o .= (($type === 'like') ? + sprintf( t('%2$d people like this.'), $spanatts, $cnt) + : + sprintf( t('%2$d people don\'t like this.'), $spanatts, $cnt) ); + $o .= EOL ; $total = count($arr); if($total >= MAX_LIKERS) $arr = array_slice($arr, 0, MAX_LIKERS - 1); @@ -1856,8 +1843,8 @@ function format_like($cnt,$arr,$type,$id) { $arr[count($arr)-1] = t('and') . ' ' . $arr[count($arr)-1]; $str = implode(', ', $arr); if($total >= MAX_LIKERS) - $str .= t(', and ') . $total - MAX_LIKERS . t(' other people'); - $str .= (($type === 'like') ? t(' like this.') : t(' don\'t like this.')); + $str .= sprintf( t(', and %d other people'), $total - MAX_LIKERS ); + $str = (($type === 'like') ? sprintf( t('%s like this.'), $str) : sprintf( t('%s don\'t like this.'), $str)); $o .= "\t" . ''; } return $o; @@ -2423,11 +2410,19 @@ function get_birthdays() { ); if($r && count($r)) { - $o .= '
' . t('Birthdays this week:') . '
'; + $total = 0; + foreach($r as $rr) + if(strlen($rr['name'])) + $total ++; + + $o .= ''; + $o .= '' ; } - $o .= '
'; + $o .= ''; } return $o;