diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-08-18 12:17:00 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-08-18 12:17:00 +0000 |
commit | 81938a3cdc7b9bd13d58e355c59d9835e830fea4 (patch) | |
tree | 4d6156a6edb7898d74d5b1836b80d08750aa39c2 /modules/drupal | |
parent | 885a29c4cd13776165c40080a00180cddd420a46 (diff) | |
download | brdo-81938a3cdc7b9bd13d58e355c59d9835e830fea4.tar.gz brdo-81938a3cdc7b9bd13d58e355c59d9835e830fea4.tar.bz2 |
#76802: Introduce placeholder magic into t()
See: http://drupal.org/node/64279#t-placeholders
Diffstat (limited to 'modules/drupal')
-rw-r--r-- | modules/drupal/drupal.module | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/modules/drupal/drupal.module b/modules/drupal/drupal.module index 40ce116c7..1e7d7fc5f 100644 --- a/modules/drupal/drupal.module +++ b/modules/drupal/drupal.module @@ -24,11 +24,11 @@ function drupal_help($section) { $output .= '<p>'. t('The Drupal module administration page allows you to set the xml-rpc server page and other related options.') .'</p>'; $output .= t('<p>You can</p> <ul> - <li>run your cron job at your site\'s <a href="%file-cron">cron page</a></li> - <li>view your <a href="%file-xmlrpc">XML-RPC page</a>.</li> - <li>administer Drupal <a href="%admin-settings-drupal">administer >> site configuration >> distributed authentication</a>.</li> + <li>run your cron job at your site\'s <a href="@file-cron">cron page</a></li> + <li>view your <a href="@file-xmlrpc">XML-RPC page</a>.</li> + <li>administer Drupal <a href="@admin-settings-drupal">administer >> site configuration >> distributed authentication</a>.</li> </ul> -', array('%file-cron' => 'cron.php', '%file-xmlrpc' => 'xmlrpc.php', '%admin-settings-drupal' => url('admin/settings/distributed-authentication'))); +', array('@file-cron' => 'cron.php', '@file-xmlrpc' => 'xmlrpc.php', '@admin-settings-drupal' => url('admin/settings/distributed-authentication'))); $output .= '<p>'. t('If you maintain a directory of sites, you can list them on a page using the <code>drupal_client_page()</code> function. Sample instructions: <ul> <li>Enable the page module. Select create content >> page.</li> @@ -42,31 +42,31 @@ print drupal_client_page(); <li>Save the page.</li> </ul>') . '</p>'; - $output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="%drupal">Drupal page</a>.', array('%drupal' => 'http://drupal.org/handbook/modules/drupal/')) .'</p>'; + $output .= '<p>'. t('For more information please read the configuration and customization handbook <a href="@drupal">Drupal page</a>.', array('@drupal' => 'http://drupal.org/handbook/modules/drupal/')) .'</p>'; return $output; case 'admin/settings/modules#description': return t('Lets you register your site with a central server and improve ranking of Drupal projects by posting information on your installed modules and themes; also enables users to log in using a Drupal ID.'); case 'admin/settings/distributed-authentication': - return t('<p>Using this your site can "call home" to another Drupal server. By calling home to drupal.org and sending a list of your installed modules and themes, you help rank projects on drupal.org and so assist all Drupal administrators to find the best components for meeting their needs. If you want to register with a different server, you can change the Drupal XML-RPC server setting -- but the server has to be able to handle Drupal XML. Some XML-RPC servers may present directories of all registered sites. To get all your site information listed, go to the <a href="%site-settings">site information settings page</a> and set the site name, the e-mail address, the slogan, and the mission statement.</p>', array('%site-settings' => url('admin/settings/site-information'))); + return t('<p>Using this your site can "call home" to another Drupal server. By calling home to drupal.org and sending a list of your installed modules and themes, you help rank projects on drupal.org and so assist all Drupal administrators to find the best components for meeting their needs. If you want to register with a different server, you can change the Drupal XML-RPC server setting -- but the server has to be able to handle Drupal XML. Some XML-RPC servers may present directories of all registered sites. To get all your site information listed, go to the <a href="@site-settings">site information settings page</a> and set the site name, the e-mail address, the slogan, and the mission statement.</p>', array('@site-settings' => url('admin/settings/site-information'))); case 'user/help#drupal': - return variable_get('drupal_authentication_service', 0) ? t("<p><a href=\"%Drupal\">Drupal</a> is the name of the software that powers %this-site. There are Drupal web sites all over the world, and many of them share their registration databases so that users may freely log in to any Drupal site using a single <strong>Drupal ID</strong>.</p> -<p>So please feel free to log in to your account here at %this-site with a username from another Drupal site. The format of a Drupal ID is similar to an e-mail address: <strong>username</strong>@<em>server</em>. An example of a valid Drupal ID is <strong>mwlily</strong>@<em>drupal.org</em>.</p>", array('%Drupal' => 'http://drupal.org', '%this-site' => '<em>'. variable_get('site_name', 'this web site') .'</em>')) : ''; + return variable_get('drupal_authentication_service', 0) ? t("<p><a href=\"@Drupal\">Drupal</a> is the name of the software that powers %this-site. There are Drupal web sites all over the world, and many of them share their registration databases so that users may freely log in to any Drupal site using a single <strong>Drupal ID</strong>.</p> +<p>So please feel free to log in to your account here at %this-site with a username from another Drupal site. The format of a Drupal ID is similar to an e-mail address: <strong>username</strong>@<em>server</em>. An example of a valid Drupal ID is <strong>mwlily</strong>@<em>drupal.org</em>.</p>", array('@Drupal' => 'http://drupal.org', '%this-site' => variable_get('site_name', 'this web site'))) : ''; } } function drupal_sites_registry_settings() { // Check if all required fields are present if ((variable_get('site_name', 'drupal') == 'drupal') || (variable_get('site_name', 'drupal') == '')) { - form_set_error('drupal_directory', t('You must set the name of your site on the <a href="%url">administer » settings » site information</a> page.', array('%url' => url('admin/settings/site-information')))); + form_set_error('drupal_directory', t('You must set the name of your site on the <a href="@url">administer » settings » site information</a> page.', array('@url' => url('admin/settings/site-information')))); } else if (variable_get('site_mail', ini_get('sendmail_from')) == '') { - form_set_error('drupal_directory', t('You must set an e-mail address for your site on the <a href="%url">site information settings page</a>.', array('%url' => url('admin/settings/site-information')))); + form_set_error('drupal_directory', t('You must set an e-mail address for your site on the <a href="@url">site information settings page</a>.', array('@url' => url('admin/settings/site-information')))); } else if (variable_get('site_slogan', '') == '') { - form_set_error('drupal_directory', t('You must set your site slogan on the <a href="%url">site information settings page</a>.', array('%url' => url('admin/settings/site-information')))); + form_set_error('drupal_directory', t('You must set your site slogan on the <a href="@url">site information settings page</a>.', array('@url' => url('admin/settings/site-information')))); } else if (variable_get('site_mission', '') == '') { - form_set_error('drupal_directory', t('You must set your site mission on the <a href="%url">site information settings page</a>.' , array('%url' => url('admin/settings/site-information')))); + form_set_error('drupal_directory', t('You must set your site mission on the <a href="@url">site information settings page</a>.' , array('@url' => url('admin/settings/site-information')))); } $options = array('1' => t('Enabled'), '0' => t('Disabled')); @@ -76,7 +76,7 @@ function drupal_sites_registry_settings() { '#title' => t('Register with a Drupal server'), '#default_value' => variable_get('drupal_register', 0), '#options' => $options, - '#description' => t("If enabled, your Drupal site will register itself with the specified Drupal XML-RPC server. For this to work properly, you must set your site's name, e-mail address, slogan and mission statement. When the \"Drupal XML-RPC server\" field is set to \"%drupal-xml-rpc\", your web site will register itself with drupal.org. Requires the cron feature to be enabled.", array("%drupal-xml-rpc" => "http://drupal.org/xmlrpc.php", "%drupal-sites" => "http://drupal.org/drupal-sites/")) + '#description' => t("If enabled, your Drupal site will register itself with the specified Drupal XML-RPC server. For this to work properly, you must set your site's name, e-mail address, slogan and mission statement. When the Drupal XML-RPC server field is set to %drupal-xml-rpc, your web site will register itself with drupal.org. Requires the cron feature to be enabled.", array("%drupal-xml-rpc" => "http://drupal.org/xmlrpc.php")) ); $form['drupal_server'] = array( @@ -130,7 +130,7 @@ function drupal_distributed_authentication_settings() { '#type' => 'textfield', '#title' => t('Default authentication server'), '#default_value' => variable_get('drupal_default_da_server', ''), - '#description' => t('The URL of the default Drupal authentication server. Omit the %http prefix (e.g. drupal.org, www.example.com, etc.). If the authentication service has been enabled, users registered at the server specified here, will not need to append the server to their user name when logging into your site. This enables users to provide a briefer, more familiar username in the login form.', array('%http' => theme('placeholder', 'http'))) + '#description' => t('The URL of the default Drupal authentication server. Omit the %http prefix (e.g. drupal.org, www.example.com, etc.). If the authentication service has been enabled, users registered at the server specified here, will not need to append the server to their user name when logging into your site. This enables users to provide a briefer, more familiar username in the login form.', array('%http' => 'http')) ); $form['drupal_default_da_server_only'] = array( @@ -202,7 +202,7 @@ function drupal_client_ping($client, $system) { db_query("INSERT INTO {client_system} (cid, name, type) VALUES (%d, '%s', '%s')", $client['cid'], $item['name'], $item['type']); } } - watchdog('client ping', t('Ping from %name (%link).', array('%name' => theme('placeholder', $client['name']), '%link' => theme('placeholder', $client['link']))), WATCHDOG_NOTICE, '<a href="'. check_url($client['link']) .'">view</a>'); + watchdog('client ping', t('Ping from %name (%link).', array('%name' => $client['name'], '%link' => $client['link'])), WATCHDOG_NOTICE, '<a href="'. check_url($client['link']) .'">view</a>'); return TRUE; } @@ -297,7 +297,7 @@ function drupal_notify($server) { $result = xmlrpc($server, 'drupal.client.ping', $client, $system); if ($result === FALSE) { - watchdog('server ping', t('Failed to notify %server; error code: %errno; error message: %error_msg.', array('%server' => theme('placeholder', $server), '%errno' => theme('placeholder', xmlrpc_errno()), '%error_msg' => theme('placeholder', xmlrpc_error_msg()))), WATCHDOG_WARNING); + watchdog('server ping', t('Failed to notify %server; error code: %errno; error message: %error_msg.', array('%server' => $server, '%errno' => xmlrpc_errno(), '%error_msg' => xmlrpc_error_msg())), WATCHDOG_WARNING); } } @@ -332,7 +332,7 @@ function drupal_auth($username, $password, $server = FALSE) { if (!empty($server)) { $result = xmlrpc("http://$server/xmlrpc.php", 'drupal.login', $username, $password); if ($result === FALSE) { - drupal_set_message(t('Error %code : %message', array('%code' => theme('placeholder', xmlrpc_errno()), '%message' => theme('placeholder', xmlrpc_error_msg()))), 'error'); + drupal_set_message(t('Error %code: %message', array('%code' => xmlrpc_errno(), '%message' => xmlrpc_error_msg())), 'error'); } else { return $result; |