Changeset 1637


Ignore:
Timestamp:
Dec 7, 2006, 12:56:24 AM (18 years ago)
Author:
rub
Message:

Proposition of translations about:

A recent picture is a last picture but a last picture is not a recent picture.
A recent category is a last category but a last category is not a recent category.

So it's a proposition about last is not like recent.

Improvement of string including decimal number in order to concord singular and plural.
Now, function l10n_dec must be used.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/feed.php

    r1636 r1637  
    189189}
    190190
    191 // build items for new images/albums
     191// build items for last images/albums
    192192$query = '
    193193SELECT date_available,
     
    212212  $exploded_date = explode_mysqldt($date);
    213213  $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']);
    215215  $item->title .= ' ('.$lang['month'][(int)$exploded_date['month']].' '.$exploded_date['day'].')';
    216216  $item->link = make_index_url(
     
    228228  $item->description .=
    229229        '<li>'
    230         .sprintf(l10n('%d new elements'), $date_detail['nb_images'])
     230        .l10n_dec('%d element added', '%d elements added', $date_detail['nb_images'])
    231231        .' ('
    232232        .'<a href="'.make_index_url(array('section'=>'recent_pics')).'">'
     
    255255  $item->description .=
    256256        '<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'])
    258259        .'</li>';
    259260  // get some categories ...
     
    275276          '<li>'
    276277          .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']).')'
    278281          .'</li>';
    279282  }
  • trunk/include/functions.inc.php

    r1631 r1637  
    936936
    937937/**
     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 */
     946function 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/**
    938953 * Translate string in string ascii7bits
    939954 * It's possible to do that with iconv_substr
  • trunk/include/functions_category.inc.php

    r1624 r1637  
    374374  if ($count > 0)
    375375  {
    376     $display_text.= sprintf(l10n(($count > 1 ? 'images_available' : 'image_available')), $count);
     376    $display_text.= l10n_dec('image_available', 'images_available', $count);
    377377
    378378    if ($cat_nb_images > 0)
     
    385385    else
    386386    {
    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);
    388388    }
    389389  }
  • trunk/include/functions_notification.inc.php

    r1550 r1637  
    348348 * Formats a news line and adds it to the array (e.g. '5 new elements')
    349349 */
    350 function add_news_line(&$news, $count, $format, $url='', $add_url=false)
     350function add_news_line(&$news, $count, $singular_fmt_key, $plural_fmt_key, $url='', $add_url=false)
    351351{
    352352  if ($count > 0)
    353353  {
    354     $line = sprintf($format, $count);
     354    $line = l10n_dec($singular_fmt_key, $plural_fmt_key, $count);
    355355    if ($add_url and !empty($url) )
    356356    {
     
    382382  if (!$exclude_img_cats)
    383383  {
    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');
    389386  }
    390387
    391388  if (!$exclude_img_cats)
    392389  {
    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');
    399392  }
    400393
    401394  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',
    403396      get_root_url().'comments.php', $add_url );
    404397
     
    406399  {
    407400    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',
    409402        get_root_url().'admin.php?page=comments', $add_url );
    410403
    411404    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',
    413406        get_root_url().'admin.php?page=user_list', $add_url );
    414407
    415408    add_news_line( $news,
    416         nb_waiting_elements(), l10n('%d waiting elements'),
     409        nb_waiting_elements(), '%d waiting element', '%d waiting elements',
    417410        get_root_url().'admin.php?page=waiting', $add_url );
    418411  }
  • trunk/language/en_UK.iso-8859-1/common.lang.php

    r1636 r1637  
    294294$lang['%.2f (rated %d times, standard deviation = %.2f)'] = '%.2f (rated %d times, standard deviation = %.2f)';
    295295$lang['%d Kb'] = '%d Kb';
     296$lang['%d category updated'] = '%d category updated';
    296297$lang['%d categories updated'] = '%d categories updated';
     298$lang['%d comment to validate'] = '%d comment to validate';
    297299$lang['%d comments to validate'] = '%d comments to validate';
     300$lang['%d new comment'] = '%d new comment';
    298301$lang['%d new comments'] = '%d new comments';
     302$lang['%d new element'] = '%d new element';
    299303$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';
    300307$lang['%d new users'] = '%d new users';
    301308$lang['%d pictures are also linked to current tags'] = '%d pictures are also linked to current tags';
    302309$lang['%d pictures'] = '%d pictures';
     310$lang['%d waiting element'] = '%d waiting element';
    303311$lang['%d waiting elements'] = '%d waiting elements';
    304312$lang['About'] = 'About';
     
    523531$lang['random_cat'] = 'Random pictures';
    524532$lang['random_cat_hint'] = 'displays a set of random pictures';
    525 $lang['recent_cats_cat'] = 'Last categories';
     533$lang['recent_cats_cat'] = 'Recent categories';
    526534$lang['recent_cats_cat_hint'] = 'displays recently updated categories';
    527535$lang['recent_image'] = 'Image within the';
    528536$lang['recent_period'] = 'Recent period';
    529 $lang['recent_pics_cat'] = 'Last pictures';
     537$lang['recent_pics_cat'] = 'Recent pictures';
    530538$lang['recent_pics_cat_hint'] = 'displays most recent pictures';
    531539$lang['redirect_msg'] = 'Redirection...';
  • trunk/language/fr_FR.iso-8859-1/common.lang.php

    r1636 r1637  
    294294$lang['%.2f (rated %d times, standard deviation = %.2f)'] = '%.2f (noté %d fois, écart type = %.2f)';
    295295$lang['%d Kb'] = '%d Ko';
     296$lang['%d category updated'] = '%d catégorie mise à jour';
    296297$lang['%d categories updated'] = '%d catégories mises à jour';
     298$lang['%d comment to validate'] = '%d commentaire utilisateur à valider';
    297299$lang['%d comments to validate'] = '%d commentaires utilisateur à valider';
     300$lang['%d new comment'] = '%d nouveau commentaire utilisateur';
    298301$lang['%d new comments'] = '%d nouveaux commentaires utilisateur';
     302$lang['%d new element'] = '%d nouvel élément';
    299303$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';
    300307$lang['%d new users'] = '%d nouveaux utilisateurs';
    301308$lang['%d pictures are also linked to current tags'] = '%d images sont également liées aux tags courants';
    302309$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';
    303312$lang['About'] = 'À propos';
    304313$lang['All tags must match'] = 'Tous les tags doivent correspondre';
     
    522531$lang['random_cat'] = 'Images au hasard';
    523532$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';
    525534$lang['recent_cats_cat_hint'] = 'afficher les catégories récemment mises à jour ou créées';
    526535$lang['recent_image'] = 'Image de moins de';
    527536$lang['recent_period'] = 'Période récente';
    528 $lang['recent_pics_cat'] = 'Dernières images';
     537$lang['recent_pics_cat'] = 'Images récentes';
    529538$lang['recent_pics_cat_hint'] = 'afficher les images les plus récentes';
    530539$lang['redirect_msg'] = 'Redirection...';
Note: See TracChangeset for help on using the changeset viewer.