Commit 33c195aa authored by Dries's avatar Dries
Browse files

- Patch #350708 by dww: t() documentation clean-up.

parent 15837026
...@@ -868,8 +868,8 @@ function fix_gpc_magic() { ...@@ -868,8 +868,8 @@ function fix_gpc_magic() {
* *
* Special variables called "placeholders" are used to signal dynamic * Special variables called "placeholders" are used to signal dynamic
* information in a string which should not be translated. Placeholders * information in a string which should not be translated. Placeholders
* can also be used for text that may change from time to time * can also be used for text that may change from time to time (such as
* (such as link paths) to be changed without requiring updates to translations. * link paths) to be changed without requiring updates to translations.
* *
* For example: * For example:
* @code * @code
...@@ -885,9 +885,9 @@ function fix_gpc_magic() { ...@@ -885,9 +885,9 @@ function fix_gpc_magic() {
* $message[] = t("If you don't want to receive such e-mails, you can change your settings at !url.", array('!url' => url("user/$account->uid", array('absolute' => TRUE)))); * $message[] = t("If you don't want to receive such e-mails, you can change your settings at !url.", array('!url' => url("user/$account->uid", array('absolute' => TRUE))));
* @endcode * @endcode
* *
* - @variable, which indicates that the text should be run through check_plain, * - @variable, which indicates that the text should be run through
* to escape HTML characters. Use this for any output that's displayed within * check_plain, to escape HTML characters. Use this for any output that's
* a Drupal page. * displayed within a Drupal page.
* @code * @code
* drupal_set_title($title = t("@name's blog", array('@name' => $account->name)), PASS_THROUGH); * drupal_set_title($title = t("@name's blog", array('@name' => $account->name)), PASS_THROUGH);
* @endcode * @endcode
...@@ -900,10 +900,10 @@ function fix_gpc_magic() { ...@@ -900,10 +900,10 @@ function fix_gpc_magic() {
* @endcode * @endcode
* *
* When using t(), try to put entire sentences and strings in one t() call. * When using t(), try to put entire sentences and strings in one t() call.
* This makes it easier for translators, as it provides context as to what each * This makes it easier for translators, as it provides context as to what
* word refers to. HTML markup within translation strings is allowed, but should * each word refers to. HTML markup within translation strings is allowed, but
* be avoided if possible. The exception are embedded links; link titles add a * should be avoided if possible. The exception are embedded links; link
* context for translators, so should be kept in the main string. * titles add a context for translators, so should be kept in the main string.
* *
* Here is an example of incorrect usage of t(): * Here is an example of incorrect usage of t():
* @code * @code
...@@ -1026,8 +1026,8 @@ function fix_gpc_magic() { ...@@ -1026,8 +1026,8 @@ function fix_gpc_magic() {
* A string containing the English string to translate. * A string containing the English string to translate.
* @param $args * @param $args
* An associative array of replacements to make after translation. Incidences * An associative array of replacements to make after translation. Incidences
* of any key in this array are replaced with the corresponding value. * of any key in this array are replaced with the corresponding value. Based
* Based on the first character of the key, the value is escaped and/or themed: * on the first character of the key, the value is escaped and/or themed:
* - !variable: inserted as is * - !variable: inserted as is
* - @variable: escape plain text to HTML (check_plain) * - @variable: escape plain text to HTML (check_plain)
* - %variable: escape text and theme as a placeholder for user-submitted * - %variable: escape text and theme as a placeholder for user-submitted
......
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