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