sprintf and not as flexible as Template::Toolkit. You can learn more about bracket notation here.
1, preceded by an underscore ( _). For example: maketext('Hello [_1], I am [_2], $your_name, $myname)
_*
[_2], [_1] seeks [_2]
There are [numf,_1] stars in the galaxy.
Do [output,strong,NOT] go in there!
[quant_1,file,files,No files] matched your query.
[quant_1 ,file ,files ,No files ] matched your query.
'This is a left bracket: ~[' renders as 'This is a left bracket: [.
'This is a right bracket: ~]' renders as 'This is a right bracket: ]'
[method,arg1,arg~,2,arg3]
[quant,_1,singular,plural]
[quant,_1,file,files] matched your query.
[quant,_1,singular,plural,zero/negative]
[quant,_1,file,files,No files] matched your query.
maketext('[numf,_1] submitted [numerate,_1,word is,words are] incorrect.',1); to render 1 submitted word is incorrect.rather than the
1 submitted 1 word is incorrect. you would see if you used quant instead.
maketext('[numf,_1] submitted [numerate,_1,word is,words are] incorrect.',42); to render 42 submitted words are incorrect.rather than the
42 submitted 42 words are incorrect. you would see if you used quant instead.
[numf,_1]
sprintf(). [sprintf,%s is %d,_1,_2]
[join,-,_*]
You chose [list,and,_*].
You chose A.
You chose A and B.
You chose A, B, and C.
You chose A, B, C, and D.
[boolean,_1,true,false]
[boolean,_1,true,false,undefined]
[output,format,_1]
Do [output,strong,NOT] go in there!
Your domain [output,class,_1,highlight] has been set up.
I [output,chr,60]3 ascii art!
url() function also takes arbitrary options in key/value pairs that become attributes in the a HTML tag.
maketext('Visit [output,url,_1,cPanel] today.', 'http://cpanel.net');
maketext('Visit [output,url,http://cpanel.net,cPanel] today.');
url() function can also take a single string in place of the “html,...,plain,...” configuration hash and handle it appropriately. For example: maketext('Visit [output,url,_1,cPanel] today.', 'http://cpanel.net'); results in:
HTML: Visit <a href="http://cpanel.net">cPanel</a> today.
CLI: Visit cPanel (http://cpanel.net) today. attr() is like class() except the arguments are a hash of arbitrary options that become attributes in the span HTML tag.
You have used [format_bytes,_1] of your allotted [format_bytes,_2].
time() — $TZ_Offset_in_seconds. time().
time().
[date|time|datetime]_format_[long|full|medium|short|default].
'date_format_long'.
datetime method directly, as in the following example:
[% locale.datetime(epoch_time_of_account_creation,'datetime_format_default') %]
The transmogrifier has been constipulated to level [_1][comment,The argument is the variable name containing the superposition of the golden ratio's decimal place in relation to pi as mildegredaded by the authoritative falloosifier.].
convert() function has been disabled.
datetime() function has also been customized.
format_bytes() uses an internal Cpanel module instead of the CPAN module listed in the POD.
maketext() phrases. Here is what you need to know.
Things that need to be quoted should use curly quotes (“”). Not straight quotes("").
You can use the following table for copying and pasting symbols:
| Symbol | Description |
|---|---|
| ™ | Trademark symbol |
| ® | Registered trademark symbol |
| © | Copyright symbol |
| “ | Left double quotation marks |
| ” | Right double quotation marks |
| … | Ellipsis |
| ‘ | Left single quotation mark |
| ’ | Right single quotation mark |
| ∞ | Infinity symbol |
Use [output,chr,34] or [output,chr,"] Use [output,chr,38] or [output,chr,&] Use [output,chr,39] or [output,chr,'] Use [output,chr,60] or [output,chr,<] Use [output,chr,62] or [output,chr,>]When using bracket notation outside of Perl (this includes YAML files), you should use the character itself:
[% locale.maketext('The file "[_1]" was updated.', file) %] <cptext 'The file “[_1]” was updated.', $file>
However, to use non-ASCII characters in Perl code, you should use grapheme cluster notation.
chr() in your string. This applies to any output() method.
Example: You need to render [output,chr,<] inside of a string that is also "strong": The less-than character [output,strong,is “<”].
To solve this problem using chr(), you would write:
The less-than character [output,strong,is 'chr(<)'].
Copyright © cPanel 2000–2011.