- Included Moshe's guidelines on the use of t().
parent
891cad97a3
commit
3a0f4b7219
|
@ -125,6 +125,18 @@ function locale_init() {
|
|||
function t($string, $args = 0) {
|
||||
global $languages;
|
||||
|
||||
/*
|
||||
** About the usage of t(). We try to keep strings whole as much as
|
||||
** possible and are unafraid of HTML markup within translation strings
|
||||
** if necessary. The suggested syntax for a link embedded within a
|
||||
** translation string is for example:
|
||||
**
|
||||
** $msg = t("You must login below or <a href=\"%url\">create a new
|
||||
** account</a> before viewing the next page.", array ("%url"
|
||||
** => drupal_url(array ("mod" => "user", "op" => "register"),
|
||||
** "module")));
|
||||
*/
|
||||
|
||||
$string = ($languages && function_exists("locale") ? locale($string) : $string);
|
||||
|
||||
if (!$args) {
|
||||
|
@ -626,8 +638,8 @@ function form_submit($value) {
|
|||
*/
|
||||
function drupal_url($args = array(), $script = "node") {
|
||||
$t = array();
|
||||
foreach ($args as $k => $v) {
|
||||
$t[] = "$k=$v";
|
||||
foreach ($args as $key => $value) {
|
||||
$t[] = "$key = $value";
|
||||
}
|
||||
return "$script.php?". implode("&", $t);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue