aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--feed.php13
-rw-r--r--include/functions.inc.php15
-rw-r--r--include/functions_category.inc.php4
-rw-r--r--include/functions_notification.inc.php29
-rw-r--r--language/en_UK.iso-8859-1/common.lang.php12
-rw-r--r--language/fr_FR.iso-8859-1/common.lang.php13
6 files changed, 57 insertions, 29 deletions
diff --git a/feed.php b/feed.php
index 64dc12aae..5ddf1d59a 100644
--- a/feed.php
+++ b/feed.php
@@ -188,7 +188,7 @@ UPDATE '.USER_FEED_TABLE.'
pwg_query($query);
}
-// build items for new images/albums
+// build items for last images/albums
$query = '
SELECT date_available,
COUNT(DISTINCT id) nb_images,
@@ -211,7 +211,7 @@ foreach($dates as $date_detail)
$date = $date_detail['date_available'];
$exploded_date = explode_mysqldt($date);
$item = new FeedItem();
- $item->title = sprintf(l10n('%d new elements'), $date_detail['nb_images']);
+ $item->title = l10n_dec('%d element added', '%d elements added', $date_detail['nb_images']);
$item->title .= ' ('.$lang['month'][(int)$exploded_date['month']].' '.$exploded_date['day'].')';
$item->link = make_index_url(
array(
@@ -227,7 +227,7 @@ foreach($dates as $date_detail)
$item->description .=
'<li>'
- .sprintf(l10n('%d new elements'), $date_detail['nb_images'])
+ .l10n_dec('%d element added', '%d elements added', $date_detail['nb_images'])
.' ('
.'<a href="'.make_index_url(array('section'=>'recent_pics')).'">'
.l10n('recent_pics_cat').'</a>'
@@ -254,7 +254,8 @@ SELECT DISTINCT id, path, name, tn_ext
$item->description .=
'<li>'
- .sprintf(l10n('%d categories updated'), $date_detail['nb_cats'])
+ .l10n_dec('%d category updated', '%d categories updated',
+ $date_detail['nb_cats'])
.'</li>';
// get some categories ...
$query = '
@@ -274,7 +275,9 @@ SELECT DISTINCT c.uppercats, COUNT(DISTINCT i.id) img_count
$item->description .=
'<li>'
.get_cat_display_name_cache($row['uppercats'])
- .' ('.sprintf(l10n('%d new elements'), $row['img_count']).')'
+ .' ('.
+ l10n_dec('%d element added',
+ '%d elements added', $row['img_count']).')'
.'</li>';
}
$item->description .= '</ul>';
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 537edc32a..bfa7ad28f 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -935,6 +935,21 @@ function l10n($key)
}
/**
+ * returns the prinft value for strings including %d
+ * return is concorded with decimal value (singular, plural)
+ *
+ * @param singular string key
+ * @param plural string key
+ * @param decimal value
+ * @return string
+ */
+function l10n_dec($singular_fmt_key, $plural_fmt_key, $decimal)
+{
+ return sprintf(l10n(($decimal > 1 ? $plural_fmt_key :
+ $singular_fmt_key)), $decimal);
+}
+
+/**
* Translate string in string ascii7bits
* It's possible to do that with iconv_substr
* but this fonction is not avaible on all the providers.
diff --git a/include/functions_category.inc.php b/include/functions_category.inc.php
index ae8b617f7..e8a066923 100644
--- a/include/functions_category.inc.php
+++ b/include/functions_category.inc.php
@@ -373,7 +373,7 @@ function get_display_images_count($cat_nb_images, $cat_count_images, $cat_count_
if ($count > 0)
{
- $display_text.= sprintf(l10n(($count > 1 ? 'images_available' : 'image_available')), $count);
+ $display_text.= l10n_dec('image_available', 'images_available', $count);
if ($cat_nb_images > 0)
{
@@ -384,7 +384,7 @@ function get_display_images_count($cat_nb_images, $cat_count_images, $cat_count_
}
else
{
- $display_text.= ' '.sprintf(l10n(($cat_count_categories > 1 ? 'images_available_cats' : 'images_available_cat')), $cat_count_categories);
+ $display_text.= ' '.l10n_dec('images_available_cat', 'images_available_cats', $cat_count_categories);
}
}
diff --git a/include/functions_notification.inc.php b/include/functions_notification.inc.php
index d90d90afa..5271a11b9 100644
--- a/include/functions_notification.inc.php
+++ b/include/functions_notification.inc.php
@@ -347,11 +347,11 @@ function news_exists($start, $end)
/**
* Formats a news line and adds it to the array (e.g. '5 new elements')
*/
-function add_news_line(&$news, $count, $format, $url='', $add_url=false)
+function add_news_line(&$news, $count, $singular_fmt_key, $plural_fmt_key, $url='', $add_url=false)
{
if ($count > 0)
{
- $line = sprintf($format, $count);
+ $line = l10n_dec($singular_fmt_key, $plural_fmt_key, $count);
if ($add_url and !empty($url) )
{
$line = '<a href="'.$url.'">'.$line.'</a>';
@@ -381,39 +381,32 @@ function news($start, $end, $exclude_img_cats=false, $add_url=false)
if (!$exclude_img_cats)
{
- $nb_new_elements = nb_new_elements($start, $end);
- if ($nb_new_elements > 0)
- {
- array_push($news, sprintf(l10n('%d new elements'), $nb_new_elements));
- }
+ add_news_line( $news,
+ nb_new_elements($start, $end), '%d new element', '%d new elements');
}
if (!$exclude_img_cats)
- {
- $nb_updated_categories = nb_updated_categories($start, $end);
- if ($nb_updated_categories > 0)
- {
- array_push($news, sprintf(l10n('%d categories updated'),
- $nb_updated_categories));
- }
+ {
+ add_news_line( $news,
+ nb_updated_categories($start, $end), '%d category updated', '%d categories updated');
}
add_news_line( $news,
- nb_new_comments($start, $end), l10n('%d new comments'),
+ nb_new_comments($start, $end), '%d new comment', '%d new comments',
get_root_url().'comments.php', $add_url );
if (is_admin())
{
add_news_line( $news,
- nb_unvalidated_comments($end), l10n('%d comments to validate'),
+ nb_unvalidated_comments($end), '%d comment to validate', '%d comments to validate',
get_root_url().'admin.php?page=comments', $add_url );
add_news_line( $news,
- nb_new_users($start, $end), l10n('%d new users'),
+ nb_new_users($start, $end), '%d new user', '%d new users',
get_root_url().'admin.php?page=user_list', $add_url );
add_news_line( $news,
- nb_waiting_elements(), l10n('%d waiting elements'),
+ nb_waiting_elements(), '%d waiting element', '%d waiting elements',
get_root_url().'admin.php?page=waiting', $add_url );
}
diff --git a/language/en_UK.iso-8859-1/common.lang.php b/language/en_UK.iso-8859-1/common.lang.php
index e23cdac02..d1f468e5b 100644
--- a/language/en_UK.iso-8859-1/common.lang.php
+++ b/language/en_UK.iso-8859-1/common.lang.php
@@ -293,13 +293,21 @@ $lang_table_translate_ascii7bits = array(
$lang['%.2f (rated %d times, standard deviation = %.2f)'] = '%.2f (rated %d times, standard deviation = %.2f)';
$lang['%d Kb'] = '%d Kb';
+$lang['%d category updated'] = '%d category updated';
$lang['%d categories updated'] = '%d categories updated';
+$lang['%d comment to validate'] = '%d comment to validate';
$lang['%d comments to validate'] = '%d comments to validate';
+$lang['%d new comment'] = '%d new comment';
$lang['%d new comments'] = '%d new comments';
+$lang['%d new element'] = '%d new element';
$lang['%d new elements'] = '%d new elements';
+$lang['%d element added'] = '%d element added';
+$lang['%d elements added'] = '%d elements added';
+$lang['%d new user'] = '%d new user';
$lang['%d new users'] = '%d new users';
$lang['%d pictures are also linked to current tags'] = '%d pictures are also linked to current tags';
$lang['%d pictures'] = '%d pictures';
+$lang['%d waiting element'] = '%d waiting element';
$lang['%d waiting elements'] = '%d waiting elements';
$lang['About'] = 'About';
$lang['All tags must match'] = 'All tags must match';
@@ -522,11 +530,11 @@ $lang['preferences'] = 'Preferences';
$lang['previous_page'] = 'Previous';
$lang['random_cat'] = 'Random pictures';
$lang['random_cat_hint'] = 'displays a set of random pictures';
-$lang['recent_cats_cat'] = 'Last categories';
+$lang['recent_cats_cat'] = 'Recent categories';
$lang['recent_cats_cat_hint'] = 'displays recently updated categories';
$lang['recent_image'] = 'Image within the';
$lang['recent_period'] = 'Recent period';
-$lang['recent_pics_cat'] = 'Last pictures';
+$lang['recent_pics_cat'] = 'Recent pictures';
$lang['recent_pics_cat_hint'] = 'displays most recent pictures';
$lang['redirect_msg'] = 'Redirection...';
$lang['reg_err_login1'] = 'Please, enter a login';
diff --git a/language/fr_FR.iso-8859-1/common.lang.php b/language/fr_FR.iso-8859-1/common.lang.php
index 1652a0524..8b12e8b2e 100644
--- a/language/fr_FR.iso-8859-1/common.lang.php
+++ b/language/fr_FR.iso-8859-1/common.lang.php
@@ -293,13 +293,22 @@ $lang_table_translate_ascii7bits = array(
$lang['%.2f (rated %d times, standard deviation = %.2f)'] = '%.2f (noté %d fois, écart type = %.2f)';
$lang['%d Kb'] = '%d Ko';
+$lang['%d category updated'] = '%d catégorie mise à jour';
$lang['%d categories updated'] = '%d catégories mises à jour';
+$lang['%d comment to validate'] = '%d commentaire utilisateur à valider';
$lang['%d comments to validate'] = '%d commentaires utilisateur à valider';
+$lang['%d new comment'] = '%d nouveau commentaire utilisateur';
$lang['%d new comments'] = '%d nouveaux commentaires utilisateur';
+$lang['%d new element'] = '%d nouvel élément';
$lang['%d new elements'] = '%d nouveaux éléments';
+$lang['%d element added'] = '%d élément ajouté';
+$lang['%d elements added'] = '%d éléments ajoutés';
+$lang['%d new user'] = '%d nouvel utilisateur';
$lang['%d new users'] = '%d nouveaux utilisateurs';
$lang['%d pictures are also linked to current tags'] = '%d images sont également liées aux tags courants';
$lang['%d pictures'] = '%d images';
+$lang['%d waiting element'] = '%d élément en attente';
+$lang['%d waiting elements'] = '%d éléments en attente';
$lang['About'] = 'À propos';
$lang['All tags must match'] = 'Tous les tags doivent correspondre';
$lang['All tags'] = 'Tous les tags';
@@ -521,11 +530,11 @@ $lang['preferences'] = 'Préférences';
$lang['previous_page'] = 'Précédent';
$lang['random_cat'] = 'Images au hasard';
$lang['random_cat_hint'] = 'afficher un ensemble aléatoire d\'images';
-$lang['recent_cats_cat'] = 'Dernières catégories';
+$lang['recent_cats_cat'] = 'Catégories récentes';
$lang['recent_cats_cat_hint'] = 'afficher les catégories récemment mises à jour ou créées';
$lang['recent_image'] = 'Image de moins de';
$lang['recent_period'] = 'Période récente';
-$lang['recent_pics_cat'] = 'Dernières images';
+$lang['recent_pics_cat'] = 'Images récentes';
$lang['recent_pics_cat_hint'] = 'afficher les images les plus récentes';
$lang['redirect_msg'] = 'Redirection...';
$lang['reg_err_login1'] = 'S\'il vous plaît, entrer un nom utilisateur';