From 2f08283864615990a47ef8b3995ab88402eda478 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Sat, 19 Oct 2013 11:04:11 +0000 Subject: feature 2978: remove useless sprintf in the core git-svn-id: http://piwigo.org/svn/trunk@25005 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/album_notification.php | 4 ++-- admin/batch_manager_global.php | 4 ++-- admin/cat_modify.php | 10 ++++----- admin/group_list.php | 26 +++++----------------- admin/group_perm.php | 7 +++--- admin/history.php | 5 +---- admin/intro.php | 9 +++----- admin/languages_new.php | 10 ++------- admin/notification_by_mail.php | 4 ++-- admin/picture_modify.php | 10 ++++----- admin/plugins_new.php | 2 +- admin/tags.php | 24 ++++++++++---------- .../default/template/batch_manager_global.tpl | 6 ++--- admin/themes/default/template/cat_perm.tpl | 2 +- admin/themes/default/template/configuration.tpl | 20 ++++++++--------- admin/themes/default/template/install.tpl | 2 +- admin/themes/default/template/intro.tpl | 2 +- .../themes/default/template/photos_add_direct.tpl | 14 ++++++------ .../themes/default/template/plugins_installed.tpl | 4 ++-- admin/themes/default/template/plugins_new.tpl | 2 +- admin/themes/default/template/themes_installed.tpl | 2 +- admin/themes/default/template/updates_ext.tpl | 6 ++--- admin/themes/default/template/updates_pwg.tpl | 14 ++++++------ admin/themes/default/template/upgrade.tpl | 8 +++---- admin/themes_installed.php | 8 +++---- admin/themes_new.php | 10 ++------- admin/user_list.php | 8 +++---- admin/user_perm.php | 7 +++--- comments.php | 4 ++-- feed.php | 2 +- include/calendar_weekly.class.php | 2 +- include/category_cats.inc.php | 4 ++-- include/functions.inc.php | 10 ++++----- include/no_photo_yet.inc.php | 4 ++-- include/template.class.php | 4 ++-- include/ws_functions.inc.php | 4 ++-- install.php | 2 +- password.php | 8 +++---- picture.php | 3 +-- plugins/LocalFilesEditor/admin.php | 2 +- search.php | 16 ++++++------- search_rules.php | 15 +++++++------ upgrade.php | 2 +- 43 files changed, 139 insertions(+), 173 deletions(-) diff --git a/admin/album_notification.php b/admin/album_notification.php index 322776302..30c1d9bb7 100644 --- a/admin/album_notification.php +++ b/admin/album_notification.php @@ -115,8 +115,8 @@ SELECT array_push( $page['infos'], - sprintf( - l10n('An information email was sent to group "%s"'), + l10n( + 'An information email was sent to group "%s"', $group_name ) ); diff --git a/admin/batch_manager_global.php b/admin/batch_manager_global.php index b64324b2d..d3cb4774a 100644 --- a/admin/batch_manager_global.php +++ b/admin/batch_manager_global.php @@ -415,10 +415,10 @@ DELETE if ('generate_derivatives' == $action) { if ($_POST['regenerateSuccess'] != '0') - array_push($page['infos'], sprintf(l10n('%s photos have been regenerated'), $_POST['regenerateSuccess'])); + array_push($page['infos'], l10n('%s photos have been regenerated', $_POST['regenerateSuccess'])); if ($_POST['regenerateError'] != '0') - array_push($page['warnings'], sprintf(l10n('%s photos can not be regenerated'), $_POST['regenerateError'])); + array_push($page['warnings'], l10n('%s photos can not be regenerated', $_POST['regenerateError'])); } diff --git a/admin/cat_modify.php b/admin/cat_modify.php index 1f83f1f3e..7edda9fe3 100644 --- a/admin/cat_modify.php +++ b/admin/cat_modify.php @@ -268,16 +268,16 @@ SELECT if ($min_date == $max_date) { - $intro = sprintf( - l10n('This album contains %d photos, added on %s.'), + $intro = l10n( + 'This album contains %d photos, added on %s.', $image_count, format_date($min_date) ); } else { - $intro = sprintf( - l10n('This album contains %d photos, added between %s and %s.'), + $intro = l10n( + 'This album contains %d photos, added between %s and %s.', $image_count, format_date($min_date), format_date($max_date) @@ -289,7 +289,7 @@ else $intro = l10n('This album contains no photo.'); } -$intro.= '
'.sprintf(l10n('Numeric identifier : %d'), $category['id']); +$intro.= '
'.l10n('Numeric identifier : %d', $category['id']); $template->assign('INTRO', $intro); diff --git a/admin/group_list.php b/admin/group_list.php index 390107613..77049b9fa 100644 --- a/admin/group_list.php +++ b/admin/group_list.php @@ -72,10 +72,7 @@ INSERT INTO '.GROUPS_TABLE.' ;'; pwg_query($query); - array_push( - $page['infos'], - sprintf(l10n('group "%s" added'), $_POST['groupname']) - ); + $page['infos'][] = l10n('group "%s" added', $_POST['groupname']); } } @@ -153,10 +150,7 @@ if (isset($_POST['submit']) and isset($_POST['selectAction']) and isset($_POST[' ;'; pwg_query($query); - array_push( - $page['infos'], - sprintf(l10n('group "%s" deleted'), $groupname) - ); + $page['infos'][] = l10n('group "%s" deleted', $groupname); } } @@ -236,10 +230,8 @@ SELECT COUNT(*) } mass_inserts(USER_GROUP_TABLE, array('user_id','group_id'), $usr_grp); mass_inserts(GROUP_ACCESS_TABLE, array('group_id','cat_id'), $grp_access); - array_push( - $page['infos'], - sprintf(l10n('group "%s" added'), $_POST['merge']) - ); + + $page['infos'][] = l10n('group "%s" added', $_POST['merge']); } // + @@ -313,10 +305,7 @@ SELECT COUNT(*) } mass_inserts(USER_GROUP_TABLE, array('user_id','group_id'), $usr_grp); - array_push( - $page['infos'], - sprintf(l10n('group "%s" added'), $_POST['duplicate_'.$group.'']) - ); + $page['infos'][] = l10n('group "%s" added', $_POST['duplicate_'.$group.'']); } } @@ -344,10 +333,7 @@ SELECT COUNT(*) ;'; pwg_query($query); - array_push( - $page['infos'], - sprintf(l10n('group "%s" updated'), $groupname) - ); + $page['infos'][] = l10n('group "%s" updated', $groupname); } } } diff --git a/admin/group_perm.php b/admin/group_perm.php index 1be0c80b7..d31102a4d 100644 --- a/admin/group_perm.php +++ b/admin/group_perm.php @@ -131,10 +131,9 @@ $template->set_filenames( $template->assign( array( 'TITLE' => - sprintf( - l10n('Manage permissions for group "%s"'), - get_groupname($page['group'] - ) + l10n( + 'Manage permissions for group "%s"', + get_groupname($page['group']) ), 'L_CAT_OPTIONS_TRUE'=>l10n('Authorized'), 'L_CAT_OPTIONS_FALSE'=>l10n('Forbidden'), diff --git a/admin/history.php b/admin/history.php index bce07a772..b74f48399 100644 --- a/admin/history.php +++ b/admin/history.php @@ -533,10 +533,7 @@ SELECT ), 'MEMBERS' => sprintf( l10n_dec('%d member', '%d members', $summary['nb_members']).': %s', - implode( - ', ', - $member_strings - ) + implode(', ', $member_strings) ), 'GUESTS' => l10n_dec( '%d guest', '%d guests', diff --git a/admin/intro.php b/admin/intro.php index c454e50b4..b8d6c8dd4 100644 --- a/admin/intro.php +++ b/admin/intro.php @@ -212,7 +212,7 @@ $template->assign( 'DB_IMAGE_TAG' => l10n_dec('%d association', '%d associations', $nb_image_tag), 'DB_USERS' => l10n_dec('%d user', '%d users', $nb_users), 'DB_GROUPS' => l10n_dec('%d group', '%d groups', $nb_groups), - 'DB_RATES' => ($nb_rates == 0) ? l10n('no rate') : sprintf(l10n('%d rates'), $nb_rates), + 'DB_RATES' => ($nb_rates == 0) ? l10n('no rate') : l10n('%d rates', $nb_rates), 'U_CHECK_UPGRADE' => PHPWG_ROOT_PATH.'admin.php?action=check_upgrade', 'U_PHPINFO' => PHPWG_ROOT_PATH.'admin.php?action=phpinfo', 'PHP_DATATIME' => $php_current_timestamp, @@ -243,7 +243,7 @@ SELECT COUNT(*) 'unvalidated', array( 'URL' => PHPWG_ROOT_PATH.'admin.php?page=comments', - 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments) + 'INFO' => l10n('%d waiting for validation', $nb_comments) ) ); } @@ -261,10 +261,7 @@ SELECT MIN(date_available) 'first_added', array( 'DB_DATE' => - sprintf( - l10n('first photo added on %s'), - format_date($first_date) - ) + l10n('first photo added on %s', format_date($first_date)) ) ); } diff --git a/admin/languages_new.php b/admin/languages_new.php index da0d31bfd..1b05a257c 100644 --- a/admin/languages_new.php +++ b/admin/languages_new.php @@ -42,13 +42,7 @@ $languages->get_db_languages(); $languages_dir = PHPWG_ROOT_PATH.'language'; if (!is_writable($languages_dir)) { - array_push( - $page['errors'], - sprintf( - l10n('Add write access to the "%s" directory'), - 'language' - ) - ); + $page['errors'][] = l10n('Add write access to the "%s" directory', 'language'); } // +-----------------------------------------------------------------------+ @@ -99,7 +93,7 @@ if (isset($_GET['installstatus'])) default: array_push( $page['errors'], - sprintf(l10n('An error occured during extraction (%s).'), htmlspecialchars($_GET['installstatus'])) + l10n('An error occured during extraction (%s).', htmlspecialchars($_GET['installstatus'])) ); } } diff --git a/admin/notification_by_mail.php b/admin/notification_by_mail.php index 9b773d870..b72a5c69b 100644 --- a/admin/notification_by_mail.php +++ b/admin/notification_by_mail.php @@ -173,8 +173,8 @@ order by array_push ( $page['infos'], - sprintf( - l10n('User %s [%s] added.'), + l10n( + 'User %s [%s] added.', stripslashes($nbm_user['username']), get_email_address_as_display_text($nbm_user['mail_address']) ) diff --git a/admin/picture_modify.php b/admin/picture_modify.php index 771f72410..68ebe7c7d 100644 --- a/admin/picture_modify.php +++ b/admin/picture_modify.php @@ -306,12 +306,12 @@ while ($user_row = pwg_db_fetch_assoc($result)) } $intro_vars = array( - 'file' => sprintf(l10n('Original file : %s'), $row['file']), - 'add_date' => sprintf(l10n('Posted %s on %s'), time_since($row['date_available'], 'year'), format_date($row['date_available'], false, false)), - 'added_by' => sprintf(l10n('Added by %s'), $row['added_by']), + 'file' => l10n('Original file : %s', $row['file']), + 'add_date' => l10n('Posted %s on %s', time_since($row['date_available'], 'year'), format_date($row['date_available'], false, false)), + 'added_by' => l10n('Added by %s', $row['added_by']), 'size' => $row['width'].'×'.$row['height'].' pixels, '.sprintf('%.2f', $row['filesize']/1024).'MB', - 'stats' => sprintf(l10n('Visited %d times'), $row['hit']), - 'id' => sprintf(l10n('Numeric identifier : %d'), $row['id']), + 'stats' => l10n('Visited %d times', $row['hit']), + 'id' => l10n('Numeric identifier : %d', $row['id']), ); if ($conf['rate'] and !empty($row['rating_score'])) diff --git a/admin/plugins_new.php b/admin/plugins_new.php index 57b05ce57..e17c97729 100644 --- a/admin/plugins_new.php +++ b/admin/plugins_new.php @@ -76,7 +76,7 @@ if (isset($_GET['installstatus'])) default: array_push($page['errors'], - sprintf(l10n('An error occured during extraction (%s).'), htmlspecialchars($_GET['installstatus'])), + l10n('An error occured during extraction (%s).', htmlspecialchars($_GET['installstatus'])), l10n('Please check "plugins" folder and sub-folders permissions (CHMOD).')); } } diff --git a/admin/tags.php b/admin/tags.php index 5da902840..4927fc4f3 100644 --- a/admin/tags.php +++ b/admin/tags.php @@ -71,8 +71,8 @@ SELECT id, name { array_push( $page['errors'], - sprintf( - l10n('Tag "%s" already exists'), + l10n( + 'Tag "%s" already exists', $tag_name ) ); @@ -136,8 +136,8 @@ SELECT id, name { array_push( $page['errors'], - sprintf( - l10n('Tag "%s" already exists'), + l10n( + 'Tag "%s" already exists', $tag_name ) ); @@ -190,8 +190,8 @@ SELECT id, name } array_push( $page['infos'], - sprintf( - l10n('Tag "%s" is now a duplicate of "%s"'), + l10n( + 'Tag "%s" is now a duplicate of "%s"', stripslashes($tag_name), $current_name_of[$tag_id] ) @@ -300,8 +300,8 @@ SELECT array_push( $page['infos'], - sprintf( - l10n('Tags %s merged into tag %s'), + l10n( + 'Tags %s merged into tag %s', implode(', ', $tags_deleted), $name_of_tag[$destination_tag_id] ) @@ -380,8 +380,8 @@ SELECT id array_push( $page['infos'], - sprintf( - l10n('Tag "%s" was added'), + l10n( + 'Tag "%s" was added', stripslashes($tag_name) ) ); @@ -390,8 +390,8 @@ SELECT id { array_push( $page['errors'], - sprintf( - l10n('Tag "%s" already exists'), + l10n( + 'Tag "%s" already exists', stripslashes($tag_name) ) ); diff --git a/admin/themes/default/template/batch_manager_global.tpl b/admin/themes/default/template/batch_manager_global.tpl index 6b6ec12ef..f3d6bf314 100644 --- a/admin/themes/default/template/batch_manager_global.tpl +++ b/admin/themes/default/template/batch_manager_global.tpl @@ -677,15 +677,15 @@ $(document).ready(function() { {'Dimensions'|@translate}
- {'Width'|@translate} {'between %d and %d pixels'|@translate|sprintf:$dimensions.selected.min_width:$dimensions.selected.max_width} + {'Width'|@translate} {'between %d and %d pixels'|@translate:$dimensions.selected.min_width:$dimensions.selected.max_width} | {'Reset'|@translate}
- {'Height'|@translate} {'between %d and %d pixels'|@translate|sprintf:$dimensions.selected.min_height:$dimensions.selected.max_height} + {'Height'|@translate} {'between %d and %d pixels'|@translate:$dimensions.selected.min_height:$dimensions.selected.max_height} | {'Reset'|@translate}
- {'Ratio'|@translate} ({'Width'|@translate}/{'Height'|@translate}) {'between %.2f and %.2f'|@translate|sprintf:$dimensions.selected.min_ratio:$dimensions.selected.max_ratio} + {'Ratio'|@translate} ({'Width'|@translate}/{'Height'|@translate}) {'between %.2f and %.2f'|@translate:$dimensions.selected.min_ratio:$dimensions.selected.max_ratio} {if isset($dimensions.ratio_portrait)} | {'Portrait'|@translate} {/if} diff --git a/admin/themes/default/template/cat_perm.tpl b/admin/themes/default/template/cat_perm.tpl index 471736569..0415c87a4 100644 --- a/admin/themes/default/template/cat_perm.tpl +++ b/admin/themes/default/template/cat_perm.tpl @@ -76,7 +76,7 @@ jQuery(document).ready(function() { {if isset($nb_users_granted_indirect)}

- {'%u users have automatic permission because they belong to a granted group.'|@translate|@sprintf:$nb_users_granted_indirect} + {'%u users have automatic permission because they belong to a granted group.'|@translate:$nb_users_granted_indirect} {'show details'|@translate} diff --git a/admin/themes/default/template/configuration.tpl b/admin/themes/default/template/configuration.tpl index ba1835d23..aab3afd00 100644 --- a/admin/themes/default/template/configuration.tpl +++ b/admin/themes/default/template/configuration.tpl @@ -610,7 +610,7 @@ jQuery(document).ready(function() {

  • @@ -624,35 +624,35 @@ jQuery(document).ready(function() {
  • @@ -671,28 +671,28 @@ jQuery(document).ready(function() {
  • diff --git a/admin/themes/default/template/install.tpl b/admin/themes/default/template/install.tpl index a668c2c16..082259338 100644 --- a/admin/themes/default/template/install.tpl +++ b/admin/themes/default/template/install.tpl @@ -279,7 +279,7 @@ jQuery().ready(function(){ldelim}