From ae093d1386d5c0678774130a8b217c660ef54785 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 7 Mar 2007 13:08:04 +0000 Subject: - Patch #115047 by mindless: token replacement with format_plural. --- modules/node/content_types.inc | 6 ++---- modules/system/system.module | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'modules') diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc index 7b2c55b95..b026292f6 100644 --- a/modules/node/content_types.inc +++ b/modules/node/content_types.inc @@ -351,9 +351,7 @@ function node_node_type($op, $info) { $update_count = node_type_update_nodes($info->old_type, $info->type); if ($update_count) { - $substr_pre = 'Changed the content type of '; - $substr_post = strtr(' from %old-type to %type.', array('%old-type' => theme('placeholder', $info->old_type), '%type' => theme('placeholder', $info->type))); - drupal_set_message(format_plural($update_count, $substr_pre .'@count post'. $substr_post, $substr_pre .'@count posts'. $substr_post)); + drupal_set_message(format_plural($update_count, 'Changed the content type of 1 post from %old-type to %type.', 'Changed the content type of @count posts from %old-type to %type.', array('%old-type' => $info->old_type, '%type' => $info->type))); } } } @@ -391,7 +389,7 @@ function node_type_delete_confirm($type) { $num_nodes = db_num_rows(db_query("SELECT * FROM {node} WHERE type = '%s'", $type->type)); if ($num_nodes) { - $caption .= '

'. strtr(format_plural($num_nodes, 'Warning: there is currently @count %type post on your site. It may not be able to be displayed or edited correctly, once you have removed this content type.', 'Warning: there are currently @count %type posts on your site. They may not be able to be displayed or edited correctly, once you have removed this content type.'), array('%type' => theme('placeholder', $type->name))) .'

'; + $caption .= '

'. format_plural($num_nodes, 'Warning: there is currently 1 %type post on your site. It may not be able to be displayed or edited correctly, once you have removed this content type.', 'Warning: there are currently @count %type posts on your site. They may not be able to be displayed or edited correctly, once you have removed this content type.', array('%type' => $type->name)) .'

'; } $caption .= '

'. t('This action cannot be undone.') .'

'; diff --git a/modules/system/system.module b/modules/system/system.module index 3bf4d19e6..206dc69bf 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1398,10 +1398,10 @@ function system_modules_confirm_form($modules, $form_values = array()) { $missing_dependencies[$k] = $info['name'] ? $info['name'] : drupal_ucfirst($dependency); } $t_argument = array( - '%module' => $modules[$name]->info['name'], - '%dependencies' => implode(', ', $missing_dependencies), + '@module' => $modules[$name]->info['name'], + '@dependencies' => implode(', ', $missing_dependencies), ); - $items[] = strtr(format_plural(count($missing_dependencies), 'You must enable the %dependencies module to install %module.', 'You must enable the %dependencies modules to install %module.'), $t_argument); + $items[] = format_plural(count($missing_dependencies), 'You must enable the @dependencies module to install @module.', 'You must enable the @dependencies modules to install @module.', $t_argument); } $form['text'] = array('#value' => theme('item_list', $items)); } -- cgit v1.2.3