Changeset 1637
- Timestamp:
- Dec 7, 2006, 12:56:24 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/feed.php
r1636 r1637 189 189 } 190 190 191 // build items for newimages/albums191 // build items for last images/albums 192 192 $query = ' 193 193 SELECT date_available, … … 212 212 $exploded_date = explode_mysqldt($date); 213 213 $item = new FeedItem(); 214 $item->title = sprintf(l10n('%d new elements'), $date_detail['nb_images']);214 $item->title = l10n_dec('%d element added', '%d elements added', $date_detail['nb_images']); 215 215 $item->title .= ' ('.$lang['month'][(int)$exploded_date['month']].' '.$exploded_date['day'].')'; 216 216 $item->link = make_index_url( … … 228 228 $item->description .= 229 229 '<li>' 230 . sprintf(l10n('%d new elements'), $date_detail['nb_images'])230 .l10n_dec('%d element added', '%d elements added', $date_detail['nb_images']) 231 231 .' (' 232 232 .'<a href="'.make_index_url(array('section'=>'recent_pics')).'">' … … 255 255 $item->description .= 256 256 '<li>' 257 .sprintf(l10n('%d categories updated'), $date_detail['nb_cats']) 257 .l10n_dec('%d category updated', '%d categories updated', 258 $date_detail['nb_cats']) 258 259 .'</li>'; 259 260 // get some categories ... … … 275 276 '<li>' 276 277 .get_cat_display_name_cache($row['uppercats']) 277 .' ('.sprintf(l10n('%d new elements'), $row['img_count']).')' 278 .' ('. 279 l10n_dec('%d element added', 280 '%d elements added', $row['img_count']).')' 278 281 .'</li>'; 279 282 } -
trunk/include/functions.inc.php
r1631 r1637 936 936 937 937 /** 938 * returns the prinft value for strings including %d 939 * return is concorded with decimal value (singular, plural) 940 * 941 * @param singular string key 942 * @param plural string key 943 * @param decimal value 944 * @return string 945 */ 946 function l10n_dec($singular_fmt_key, $plural_fmt_key, $decimal) 947 { 948 return sprintf(l10n(($decimal > 1 ? $plural_fmt_key : 949 $singular_fmt_key)), $decimal); 950 } 951 952 /** 938 953 * Translate string in string ascii7bits 939 954 * It's possible to do that with iconv_substr -
trunk/include/functions_category.inc.php
r1624 r1637 374 374 if ($count > 0) 375 375 { 376 $display_text.= sprintf(l10n(($count > 1 ? 'images_available' : 'image_available')), $count);376 $display_text.= l10n_dec('image_available', 'images_available', $count); 377 377 378 378 if ($cat_nb_images > 0) … … 385 385 else 386 386 { 387 $display_text.= ' '. sprintf(l10n(($cat_count_categories > 1 ? 'images_available_cats' : 'images_available_cat')), $cat_count_categories);387 $display_text.= ' '.l10n_dec('images_available_cat', 'images_available_cats', $cat_count_categories); 388 388 } 389 389 } -
trunk/include/functions_notification.inc.php
r1550 r1637 348 348 * Formats a news line and adds it to the array (e.g. '5 new elements') 349 349 */ 350 function add_news_line(&$news, $count, $ format, $url='', $add_url=false)350 function add_news_line(&$news, $count, $singular_fmt_key, $plural_fmt_key, $url='', $add_url=false) 351 351 { 352 352 if ($count > 0) 353 353 { 354 $line = sprintf($format, $count);354 $line = l10n_dec($singular_fmt_key, $plural_fmt_key, $count); 355 355 if ($add_url and !empty($url) ) 356 356 { … … 382 382 if (!$exclude_img_cats) 383 383 { 384 $nb_new_elements = nb_new_elements($start, $end); 385 if ($nb_new_elements > 0) 386 { 387 array_push($news, sprintf(l10n('%d new elements'), $nb_new_elements)); 388 } 384 add_news_line( $news, 385 nb_new_elements($start, $end), '%d new element', '%d new elements'); 389 386 } 390 387 391 388 if (!$exclude_img_cats) 392 389 { 393 $nb_updated_categories = nb_updated_categories($start, $end); 394 if ($nb_updated_categories > 0) 395 { 396 array_push($news, sprintf(l10n('%d categories updated'), 397 $nb_updated_categories)); 398 } 390 add_news_line( $news, 391 nb_updated_categories($start, $end), '%d category updated', '%d categories updated'); 399 392 } 400 393 401 394 add_news_line( $news, 402 nb_new_comments($start, $end), l10n('%d new comments'),395 nb_new_comments($start, $end), '%d new comment', '%d new comments', 403 396 get_root_url().'comments.php', $add_url ); 404 397 … … 406 399 { 407 400 add_news_line( $news, 408 nb_unvalidated_comments($end), l10n('%d comments to validate'),401 nb_unvalidated_comments($end), '%d comment to validate', '%d comments to validate', 409 402 get_root_url().'admin.php?page=comments', $add_url ); 410 403 411 404 add_news_line( $news, 412 nb_new_users($start, $end), l10n('%d new users'),405 nb_new_users($start, $end), '%d new user', '%d new users', 413 406 get_root_url().'admin.php?page=user_list', $add_url ); 414 407 415 408 add_news_line( $news, 416 nb_waiting_elements(), l10n('%d waiting elements'),409 nb_waiting_elements(), '%d waiting element', '%d waiting elements', 417 410 get_root_url().'admin.php?page=waiting', $add_url ); 418 411 } -
trunk/language/en_UK.iso-8859-1/common.lang.php
r1636 r1637 294 294 $lang['%.2f (rated %d times, standard deviation = %.2f)'] = '%.2f (rated %d times, standard deviation = %.2f)'; 295 295 $lang['%d Kb'] = '%d Kb'; 296 $lang['%d category updated'] = '%d category updated'; 296 297 $lang['%d categories updated'] = '%d categories updated'; 298 $lang['%d comment to validate'] = '%d comment to validate'; 297 299 $lang['%d comments to validate'] = '%d comments to validate'; 300 $lang['%d new comment'] = '%d new comment'; 298 301 $lang['%d new comments'] = '%d new comments'; 302 $lang['%d new element'] = '%d new element'; 299 303 $lang['%d new elements'] = '%d new elements'; 304 $lang['%d element added'] = '%d element added'; 305 $lang['%d elements added'] = '%d elements added'; 306 $lang['%d new user'] = '%d new user'; 300 307 $lang['%d new users'] = '%d new users'; 301 308 $lang['%d pictures are also linked to current tags'] = '%d pictures are also linked to current tags'; 302 309 $lang['%d pictures'] = '%d pictures'; 310 $lang['%d waiting element'] = '%d waiting element'; 303 311 $lang['%d waiting elements'] = '%d waiting elements'; 304 312 $lang['About'] = 'About'; … … 523 531 $lang['random_cat'] = 'Random pictures'; 524 532 $lang['random_cat_hint'] = 'displays a set of random pictures'; 525 $lang['recent_cats_cat'] = ' Last categories';533 $lang['recent_cats_cat'] = 'Recent categories'; 526 534 $lang['recent_cats_cat_hint'] = 'displays recently updated categories'; 527 535 $lang['recent_image'] = 'Image within the'; 528 536 $lang['recent_period'] = 'Recent period'; 529 $lang['recent_pics_cat'] = ' Last pictures';537 $lang['recent_pics_cat'] = 'Recent pictures'; 530 538 $lang['recent_pics_cat_hint'] = 'displays most recent pictures'; 531 539 $lang['redirect_msg'] = 'Redirection...'; -
trunk/language/fr_FR.iso-8859-1/common.lang.php
r1636 r1637 294 294 $lang['%.2f (rated %d times, standard deviation = %.2f)'] = '%.2f (noté %d fois, écart type = %.2f)'; 295 295 $lang['%d Kb'] = '%d Ko'; 296 $lang['%d category updated'] = '%d catégorie mise à jour'; 296 297 $lang['%d categories updated'] = '%d catégories mises à jour'; 298 $lang['%d comment to validate'] = '%d commentaire utilisateur à valider'; 297 299 $lang['%d comments to validate'] = '%d commentaires utilisateur à valider'; 300 $lang['%d new comment'] = '%d nouveau commentaire utilisateur'; 298 301 $lang['%d new comments'] = '%d nouveaux commentaires utilisateur'; 302 $lang['%d new element'] = '%d nouvel élément'; 299 303 $lang['%d new elements'] = '%d nouveaux éléments'; 304 $lang['%d element added'] = '%d élément ajouté'; 305 $lang['%d elements added'] = '%d éléments ajoutés'; 306 $lang['%d new user'] = '%d nouvel utilisateur'; 300 307 $lang['%d new users'] = '%d nouveaux utilisateurs'; 301 308 $lang['%d pictures are also linked to current tags'] = '%d images sont également liées aux tags courants'; 302 309 $lang['%d pictures'] = '%d images'; 310 $lang['%d waiting element'] = '%d élément en attente'; 311 $lang['%d waiting elements'] = '%d éléments en attente'; 303 312 $lang['About'] = 'À propos'; 304 313 $lang['All tags must match'] = 'Tous les tags doivent correspondre'; … … 522 531 $lang['random_cat'] = 'Images au hasard'; 523 532 $lang['random_cat_hint'] = 'afficher un ensemble aléatoire d\'images'; 524 $lang['recent_cats_cat'] = ' Dernières catégories';533 $lang['recent_cats_cat'] = 'Catégories récentes'; 525 534 $lang['recent_cats_cat_hint'] = 'afficher les catégories récemment mises à jour ou créées'; 526 535 $lang['recent_image'] = 'Image de moins de'; 527 536 $lang['recent_period'] = 'Période récente'; 528 $lang['recent_pics_cat'] = ' Dernières images';537 $lang['recent_pics_cat'] = 'Images récentes'; 529 538 $lang['recent_pics_cat_hint'] = 'afficher les images les plus récentes'; 530 539 $lang['redirect_msg'] = 'Redirection...';
Note: See TracChangeset
for help on using the changeset viewer.