[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/I18N/ -> TChoiceFormat.php (sommaire)

TChoiceFormat, I18N choice format component.

Author: Wei Zhuo
Copyright: Copyright © 2005 PradoSoft
License: http://www.pradosoft.com/license/
Version: $Id: TChoiceFormat.php 1397 2006-09-07 07:55:53Z wei $
Poids: 89 lignes (3 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

TChoiceFormat:: (3 méthodes):
  getValue()
  setValue()
  translateText()


Classe: TChoiceFormat  - X-Ref

TChoiceFormat class.

This component performs message/string choice translation. The translation
source is set in the TGlobalization module. The following example
demonstrates a simple 2 choice message translation.
<code>
<com:TChoiceFormat Value="1">[1] One Apple. |[2] Two Apples</com:TChoiceFormat>
</code>

The Choice has <b>Value</b> "1" (one), thus the translated string
is "One Apple". If the <b>Value</b> is "2", then it will show
"Two Apples".

The message/string choices are separated by the pipe "|" followed
by a set notation of the form
# <tt>[1,2]</tt> -- accepts values between 1 and 2, inclusive.
# <tt>(1,2)</tt> -- accepts values between 1 and 2, excluding 1 and 2.
# <tt>{1,2,3,4}</tt> -- only values defined in the set are accepted.
# <tt>[-Inf,0)</tt> -- accepts value greater or equal to negative infinity
and strictly less than 0
Any non-empty combinations of the delimiters of square and round brackets
are acceptable.

The string choosen for display depends on the <b>Value</b> property.
The <b>Value</b> is evaluated for each set until the Value is found
to belong to a particular set.

Properties
- <b>Value</b>, float,
<br>Gets or sets the Value that determines which string choice to display.

getValue()   X-Ref

return: float the numerical value.

setValue($value)   X-Ref
Sets the numerical choice value

param: float the choice value

translateText($text, $subs)   X-Ref
Display the choosen translated string.
Overrides the parent method, also calls parent's renderBody to
translate.




Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7