data/TWiki/VarMAKETEXT.txt
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
permissions -rw-r--r--
RELEASE 4.2.0 freetown
     1 %META:TOPICINFO{author="TWikiContributor" date="1197443560" format="1.1" version="3"}%
     2 %META:TOPICPARENT{name="TWikiVariables"}%
     3 #VarMAKETEXT
     4 ---+++ MAKETEXT -- creates text using TWiki's <nop>I18N infrastructure
     5    * Syntax: =%<nop>MAKETEXT{"string" args="..."}%=
     6    * Supported parameters:
     7      | *Parameter* | *Description* | *Default* |
     8      | ="text"= or =string="text"= | The text to be displayed. | _none_ |
     9      | =args="param1, param2"= | a comma-separated list of arguments to be interpolated in the string, replacing the =[_N]= placeholders in it. | _none_ |
    10    * Examples:
    11       * =%<nop>MAKETEXT{string="Notes:"}%=
    12         %BR% expands to %BR%
    13         <em> %MAKETEXT{string="Notes:"}% </em>
    14       * =%<nop>MAKETEXT{"If you have any questions, please contact [_1]." args="%<nop>WIKIWEBMASTER%"}%=
    15         %BR% expands to %BR%
    16         <em> %MAKETEXT{"If you have any questions, please contact [_1]." args="%WIKIWEBMASTER%"}% </em>
    17       * =%<nop>MAKETEXT{"Did you want to [<nop>[<nop>[<nop>_1]<nop>]<nop>[reset [_2]'s password]<nop>]<nop>?" args="%<nop>SYSTEMWEB%.ResetPassword,%<nop>WIKIUSERNAME%"}%=
    18         %BR% expands to %BR%
    19         <em> %MAKETEXT{"Did you want to [[[_1]][reset [_2]'s password]]?" args="TWiki.ResetPassword,%WIKIUSERNAME%"}% </em>
    20    * __Notes:__
    21       * TWiki will translate the =string= to the current user's language _only_
    22         if it has such string in its translation table for that language.
    23       * Amperstands (<code>&amp;</code>) followed by one letter (one of a...z, A...Z)
    24         (say, =X=) in the translatable string will be translated to 
    25         <code>&lt;span class='twikiAccessKey'&gt;X&lt;/span&gt;</code>.
    26         This is used to implement access keys.
    27         If you want to write an actual amperstand that stays just before a letter,
    28         write two consecutive amperstands (<code>&amp;&amp;</code>): they will
    29         be transformed in just one.
    30       * translatable string starting with underscores (<code>_</code>) are reserved. You
    31         *cannot* use translatable phrases starting with an underscore.
    32       * Make sure that the translatable string is _constant_. Specially, do *not*
    33         include <code>%<nop>VARIABLES%</code> inside the translatable strings
    34         (since they will get expanded *before* the <code>%<nop>MAKETEXT{...}%</code>
    35         itself is handled).
    36