Commit 0529e79a authored by Dries's avatar Dries

Patch by Goba:

 - put text directly into t(), which also means that multipart help text becomes
   a multiline string
 - use modern XHTML tagging, no <b> and <i>
 - put links and URLs out of the translated text where appropriate
 - let referred menu items and form elements get the same name as in the menu /
   form, so only one translation would be needed
 - use %variable instead of $variable when variables need to go into the string
 - add translation to form items previously untranslated
 - use example.com in example URLs
parent 7883ea6e
......@@ -2,30 +2,24 @@
// $Id$
function drupal_help($section = "admin/help#drupal") {
$output = "";
switch ($section) {
case 'admin/help#drupal':
$output .= "<p>The \"Drupal\" module features a capability whereby other drupal sites may <i>call home</i> to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.</p>";
$output .= "<p>Currently, the main application of this feature is the %drupal-sites. By default, fresh Drupal installations can use %Drupal as their <i>directory server</i> and report their existence. This reporting occurs via scheduled %xml-rpc pings.</p>";
$output .= "<p>Drupal administrators should simply enable this feature to get listed on the %drupal-sites; just set your site's name, e-mail address, slogan and mission statement. Then make sure that the field called <i>Drupal XML-RPC server</i> on the %drupal-settings page is set to http://www.drupal.org/xmlrpc.php, and enable this feature using the dropdown directly below.</p>";
$output .= "<p>The listing of your site will occur shortly after your site's next %cron. Note that cron.php should be called using the domain name which you want to have listed at %Drupal. For example, don't kick off cron by requesting http://127.0.0.1/cron.php. Instead, use a publicly accessible domain name such as http://www.mydomain.org/cron.php.</p>";
$output .= "<p>Also note that your installation need not use drupal.org as its directory server. For example, this feature is perfectly capable of aggregating pings from all of your departmental drupal installations sites within an enterprise.</p>";
$output = t($output, array("%drupal-sites" => "<a href=\"http://www.drupal.org/node/view/3\">". t("Drupal sites page") ."</a>", "%Drupal" => "<a href=\"http://www.drupal.org\">drupal.org</a>", "%xml-rpc" => "<a href=\"http://www.xmlrpc.com/\">XLM-RPC</a>", "%drupal-settings" => l(t("administer") ." &raquo; ". t("configuration") ." &raquo; ". t("modules") ." &raquo; ". t("drupal"), "admin/system/modules/drupal"), "%cron" => l(t("cron run"), "admin/system/help#cron")));
return t("<p>The \"Drupal\" module features a capability whereby other drupal sites may <em>call home</em> to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.</p>
<p>Currently, the main application of this feature is the %drupal-sites page. By default, fresh Drupal installations can use %Drupal as their <em>directory server</em> and report their existence. This reporting occurs via scheduled %xml-rpc pings.</p>
<p>Drupal administrators should simply enable this feature to get listed on the %drupal-sites page. Just set your site's name, e-mail address, slogan and mission statement on the %site-admin page. Then make sure that the field called <em>%xml-rpc-server</em> on the %drupal-settings page is set to %drupal-xml-rpc, and enable this feature using the dropdown directly below.</p>
<p>The listing of your site will occur shortly after your site's next %cron-run. Note that cron.php should be called using the domain name which you want to have listed at %Drupal. For example, don't kick off cron by requesting http://127.0.0.1/cron.php. Instead, use a publicly accessible domain name such as http://www.example.com/cron.php.</p>
<p>Also note that your installation need not use drupal.org as its directory server. For example, this feature is perfectly capable of aggregating pings from all of your departmental drupal installations sites within an enterprise.</p>", array("%drupal-sites" => "<a href=\"http://www.drupal.org/sites\">".t("Drupal sites")."</a>", "%Drupal" => "<a href=\"http://www.drupal.org\">drupal.org</a>", "%xml-rpc" => "<a href=\"http://www.xmlrpc.com/\">XLM-RPC</a>", "%site-admin" => l(t("site administration"), "admin/system"), "%xml-rpc-server" => t("Drupal XML-RPC server"), "%drupal-settings" => l(t("administer") ." &raquo; ". t("configuration") ." &raquo; ". t("modules") ." &raquo; ". t("drupal"), "admin/system/modules/drupal"), "%drupal-xml-rpc" => "http://www.drupal.org/xmlrpc.php", "%cron" => l(t("cron run"), "admin/system/help#cron")));
break;
case 'admin/system/modules#description':
$output = t("Lets users log in using a Drupal ID and can notify drupal.org about your site.");
return t("Lets users log in using a Drupal ID and can notify a central server about your site.");
break;
case 'admin/system/modules/drupal':
$output = t("Using this your Drupal site can \"call home\" and add itself to the Drupal directory. If you want it to add itself to a different directory server you can change the %Drupal-setting setting -- but the directory server has to be able to handle Drupal XML. To get a full site listing go to the %general and set the site name, the e-mail address, the slogan, and the mission statement.", array("%Drupal-setting" => l(t("Drupal XML-RPC server"), "admin/system/modules/drupal"), "%general" => l(t("site configuration"), "admin/system")));
return t("Using this your Drupal site can \"call home\" and add itself to the Drupal directory. If you want it to add itself to a different directory server you can change the %xml-rpc-setting setting -- but the directory server has to be able to handle Drupal XML. To get all your site information listed go to the %site-admin page and set the site name, the e-mail address, the slogan, and the mission statement.", array("%xml-rpc-setting" => l(t("Drupal XML-RPC server"), "admin/system/modules/drupal"), "%site-admin" => l(t("site configuration"), "admin/system")));
break;
case 'user/help#drupal':
$site = variable_get("site_name", "this web site");
$output = "<p>%drupal is the name of the software which powers %site. There are Drupal web sites all over the world, and many of them share their registration databases so that users may freely login to any Drupal site using a single <b>Drupal ID</b>.</p>\n";
$output .= "<p>So please feel free to login to your account here at %site with a username from another Drupal site. The format of a Drupal ID is similar to an email address: <b>username</b>@<i>server</i>. An example of valid Drupal ID is <b>mwlily</b>@<i>www.drupal.org</i>.</p>";
$output = t($output, array("%drupal" => "<a href=\"http://www.drupal.org\">Drupal</a>", "%site" => "<i>$site</i>"));
return t("<p>%Drupal is the name of the software which 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 login to any Drupal site using a single <strong>Drupal ID</strong>.</p>
<p>So please feel free to login to your account here at %this-site with a username from another Drupal site. The format of a Drupal ID is similar to an email address: <strong>username</strong>@<em>server</em>. An example of a valid Drupal ID is <strong>mwlily</strong>@<em>www.drupal.org</em>.</p>", array("%Drupal" => "<a href=\"http://www.drupal.org\">Drupal</a>", "%this-site" => "<em>".variable_get("site_name", "this web site")."</em>"));
break;
}
......@@ -33,8 +27,8 @@ function drupal_help($section = "admin/help#drupal") {
}
function drupal_settings() {
$output .= form_textfield("Drupal XML-RPC server", "drupal_server", variable_get("drupal_server", "http://www.drupal.org/xmlrpc.php"), 55, 128, "The URL of your root Drupal XML-RPC server.");
$output .= form_radios("Drupal directory", "drupal_directory", variable_get("drupal_directory", 0), array("Disabled", "Enabled"), "If enabled, your Drupal site will make itself known to the Drupal directory at 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 \"http://www.drupal.org/xmlrpc.php\", your web site will get listed on <a href=\"http://www.drupal.org/\">http://www.drupal.org/</a>. Requires crontab.");
$output = form_textfield(t("Drupal XML-RPC server"), "drupal_server", variable_get("drupal_server", "http://www.drupal.org/xmlrpc.php"), 55, 128, t("The URL of your root Drupal XML-RPC server."));
$output .= form_radios(t("Drupal directory"), "drupal_directory", variable_get("drupal_directory", 0), array(t("Disabled"), t("Enabled")), t("If enabled, your Drupal site will make itself known to the Drupal directory at 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 \"%xml-rpc-server\" field is set to \"%drupal-xml-rpc\", your web site will get listed on the %drupal-sites page. Requires the cron feature to be enabled.", array("%xml-rpc-server" => t("Drupal XML-RPC server"), "%drupal-xml-rpc" => "http://www.drupal.org/xmlrpc.php", "%drupal-sites" => "<a href=\"http://www.drupal.org/sites\">".t("Drupal sites")."</a>")));
return $output;
}
......@@ -157,12 +151,12 @@ function drupal_auth($username, $password, $server) {
function drupal_link($type) {
if ($type == "system") {
menu("drupal", "Drupal", "drupal_page", 0, MENU_HIDE);
menu("drupal", t("Drupal"), "drupal_page", 0, MENU_HIDE);
}
}
function drupal_page() {
print theme("page", drupal_help("user/help#drupal"), "Drupal");
print theme("page", drupal_help("user/help#drupal"), t("Drupal"));
}
function drupal_login($arguments) {
......@@ -187,14 +181,14 @@ function drupal_user($type, $edit, $user) {
switch ($type) {
case "view_private":
$result = user_get_authname($user, $module);
$title = t("%name ID", array("%name" => $name));
if ($result) {
$output .= form_item(t("$name ID"), $result);
return form_item($title, $result);
}
else {
// TODO: use a variation of $base_url instead of $HTTP_HOST below
$output .= form_item(t("$name ID"), "$user->name@". $_SERVER["HTTP_HOST"]);
return form_item($title, "$user->name@". $_SERVER["HTTP_HOST"]);
}
return $output;
}
}
......
......@@ -2,30 +2,24 @@
// $Id$
function drupal_help($section = "admin/help#drupal") {
$output = "";
switch ($section) {
case 'admin/help#drupal':
$output .= "<p>The \"Drupal\" module features a capability whereby other drupal sites may <i>call home</i> to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.</p>";
$output .= "<p>Currently, the main application of this feature is the %drupal-sites. By default, fresh Drupal installations can use %Drupal as their <i>directory server</i> and report their existence. This reporting occurs via scheduled %xml-rpc pings.</p>";
$output .= "<p>Drupal administrators should simply enable this feature to get listed on the %drupal-sites; just set your site's name, e-mail address, slogan and mission statement. Then make sure that the field called <i>Drupal XML-RPC server</i> on the %drupal-settings page is set to http://www.drupal.org/xmlrpc.php, and enable this feature using the dropdown directly below.</p>";
$output .= "<p>The listing of your site will occur shortly after your site's next %cron. Note that cron.php should be called using the domain name which you want to have listed at %Drupal. For example, don't kick off cron by requesting http://127.0.0.1/cron.php. Instead, use a publicly accessible domain name such as http://www.mydomain.org/cron.php.</p>";
$output .= "<p>Also note that your installation need not use drupal.org as its directory server. For example, this feature is perfectly capable of aggregating pings from all of your departmental drupal installations sites within an enterprise.</p>";
$output = t($output, array("%drupal-sites" => "<a href=\"http://www.drupal.org/node/view/3\">". t("Drupal sites page") ."</a>", "%Drupal" => "<a href=\"http://www.drupal.org\">drupal.org</a>", "%xml-rpc" => "<a href=\"http://www.xmlrpc.com/\">XLM-RPC</a>", "%drupal-settings" => l(t("administer") ." &raquo; ". t("configuration") ." &raquo; ". t("modules") ." &raquo; ". t("drupal"), "admin/system/modules/drupal"), "%cron" => l(t("cron run"), "admin/system/help#cron")));
return t("<p>The \"Drupal\" module features a capability whereby other drupal sites may <em>call home</em> to report their existence. In turn, this enables a pod of Drupal sites to find, cooperate and advertise each other.</p>
<p>Currently, the main application of this feature is the %drupal-sites page. By default, fresh Drupal installations can use %Drupal as their <em>directory server</em> and report their existence. This reporting occurs via scheduled %xml-rpc pings.</p>
<p>Drupal administrators should simply enable this feature to get listed on the %drupal-sites page. Just set your site's name, e-mail address, slogan and mission statement on the %site-admin page. Then make sure that the field called <em>%xml-rpc-server</em> on the %drupal-settings page is set to %drupal-xml-rpc, and enable this feature using the dropdown directly below.</p>
<p>The listing of your site will occur shortly after your site's next %cron-run. Note that cron.php should be called using the domain name which you want to have listed at %Drupal. For example, don't kick off cron by requesting http://127.0.0.1/cron.php. Instead, use a publicly accessible domain name such as http://www.example.com/cron.php.</p>
<p>Also note that your installation need not use drupal.org as its directory server. For example, this feature is perfectly capable of aggregating pings from all of your departmental drupal installations sites within an enterprise.</p>", array("%drupal-sites" => "<a href=\"http://www.drupal.org/sites\">".t("Drupal sites")."</a>", "%Drupal" => "<a href=\"http://www.drupal.org\">drupal.org</a>", "%xml-rpc" => "<a href=\"http://www.xmlrpc.com/\">XLM-RPC</a>", "%site-admin" => l(t("site administration"), "admin/system"), "%xml-rpc-server" => t("Drupal XML-RPC server"), "%drupal-settings" => l(t("administer") ." &raquo; ". t("configuration") ." &raquo; ". t("modules") ." &raquo; ". t("drupal"), "admin/system/modules/drupal"), "%drupal-xml-rpc" => "http://www.drupal.org/xmlrpc.php", "%cron" => l(t("cron run"), "admin/system/help#cron")));
break;
case 'admin/system/modules#description':
$output = t("Lets users log in using a Drupal ID and can notify drupal.org about your site.");
return t("Lets users log in using a Drupal ID and can notify a central server about your site.");
break;
case 'admin/system/modules/drupal':
$output = t("Using this your Drupal site can \"call home\" and add itself to the Drupal directory. If you want it to add itself to a different directory server you can change the %Drupal-setting setting -- but the directory server has to be able to handle Drupal XML. To get a full site listing go to the %general and set the site name, the e-mail address, the slogan, and the mission statement.", array("%Drupal-setting" => l(t("Drupal XML-RPC server"), "admin/system/modules/drupal"), "%general" => l(t("site configuration"), "admin/system")));
return t("Using this your Drupal site can \"call home\" and add itself to the Drupal directory. If you want it to add itself to a different directory server you can change the %xml-rpc-setting setting -- but the directory server has to be able to handle Drupal XML. To get all your site information listed go to the %site-admin page and set the site name, the e-mail address, the slogan, and the mission statement.", array("%xml-rpc-setting" => l(t("Drupal XML-RPC server"), "admin/system/modules/drupal"), "%site-admin" => l(t("site configuration"), "admin/system")));
break;
case 'user/help#drupal':
$site = variable_get("site_name", "this web site");
$output = "<p>%drupal is the name of the software which powers %site. There are Drupal web sites all over the world, and many of them share their registration databases so that users may freely login to any Drupal site using a single <b>Drupal ID</b>.</p>\n";
$output .= "<p>So please feel free to login to your account here at %site with a username from another Drupal site. The format of a Drupal ID is similar to an email address: <b>username</b>@<i>server</i>. An example of valid Drupal ID is <b>mwlily</b>@<i>www.drupal.org</i>.</p>";
$output = t($output, array("%drupal" => "<a href=\"http://www.drupal.org\">Drupal</a>", "%site" => "<i>$site</i>"));
return t("<p>%Drupal is the name of the software which 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 login to any Drupal site using a single <strong>Drupal ID</strong>.</p>
<p>So please feel free to login to your account here at %this-site with a username from another Drupal site. The format of a Drupal ID is similar to an email address: <strong>username</strong>@<em>server</em>. An example of a valid Drupal ID is <strong>mwlily</strong>@<em>www.drupal.org</em>.</p>", array("%Drupal" => "<a href=\"http://www.drupal.org\">Drupal</a>", "%this-site" => "<em>".variable_get("site_name", "this web site")."</em>"));
break;
}
......@@ -33,8 +27,8 @@ function drupal_help($section = "admin/help#drupal") {
}
function drupal_settings() {
$output .= form_textfield("Drupal XML-RPC server", "drupal_server", variable_get("drupal_server", "http://www.drupal.org/xmlrpc.php"), 55, 128, "The URL of your root Drupal XML-RPC server.");
$output .= form_radios("Drupal directory", "drupal_directory", variable_get("drupal_directory", 0), array("Disabled", "Enabled"), "If enabled, your Drupal site will make itself known to the Drupal directory at 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 \"http://www.drupal.org/xmlrpc.php\", your web site will get listed on <a href=\"http://www.drupal.org/\">http://www.drupal.org/</a>. Requires crontab.");
$output = form_textfield(t("Drupal XML-RPC server"), "drupal_server", variable_get("drupal_server", "http://www.drupal.org/xmlrpc.php"), 55, 128, t("The URL of your root Drupal XML-RPC server."));
$output .= form_radios(t("Drupal directory"), "drupal_directory", variable_get("drupal_directory", 0), array(t("Disabled"), t("Enabled")), t("If enabled, your Drupal site will make itself known to the Drupal directory at 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 \"%xml-rpc-server\" field is set to \"%drupal-xml-rpc\", your web site will get listed on the %drupal-sites page. Requires the cron feature to be enabled.", array("%xml-rpc-server" => t("Drupal XML-RPC server"), "%drupal-xml-rpc" => "http://www.drupal.org/xmlrpc.php", "%drupal-sites" => "<a href=\"http://www.drupal.org/sites\">".t("Drupal sites")."</a>")));
return $output;
}
......@@ -157,12 +151,12 @@ function drupal_auth($username, $password, $server) {
function drupal_link($type) {
if ($type == "system") {
menu("drupal", "Drupal", "drupal_page", 0, MENU_HIDE);
menu("drupal", t("Drupal"), "drupal_page", 0, MENU_HIDE);
}
}
function drupal_page() {
print theme("page", drupal_help("user/help#drupal"), "Drupal");
print theme("page", drupal_help("user/help#drupal"), t("Drupal"));
}
function drupal_login($arguments) {
......@@ -187,14 +181,14 @@ function drupal_user($type, $edit, $user) {
switch ($type) {
case "view_private":
$result = user_get_authname($user, $module);
$title = t("%name ID", array("%name" => $name));
if ($result) {
$output .= form_item(t("$name ID"), $result);
return form_item($title, $result);
}
else {
// TODO: use a variation of $base_url instead of $HTTP_HOST below
$output .= form_item(t("$name ID"), "$user->name@". $_SERVER["HTTP_HOST"]);
return form_item($title, "$user->name@". $_SERVER["HTTP_HOST"]);
}
return $output;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment