Ignore:
Timestamp:
Dec 7, 2006, 12:56:24 AM (17 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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  }
Note: See TracChangeset for help on using the changeset viewer.