From 63c79dd722d5a8dd09b8828a4711d496680c0062 Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 3 Apr 2006 21:55:33 +0000 Subject: Cleanup of I18N. --- framework/I18N/TChoiceFormat.php | 42 +++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 24 deletions(-) (limited to 'framework/I18N/TChoiceFormat.php') diff --git a/framework/I18N/TChoiceFormat.php b/framework/I18N/TChoiceFormat.php index 255bf638..cd6ef511 100644 --- a/framework/I18N/TChoiceFormat.php +++ b/framework/I18N/TChoiceFormat.php @@ -1,18 +1,12 @@ - * @version $Revision: 1.2 $ $Date: 2005/04/24 00:21:13 $ + * @author Wei Zhuo + * @link http://www.pradosoft.com/ + * @copyright Copyright © 2005 PradoSoft + * @license http://www.pradosoft.com/license/ + * @version $Revision: $ $Date: $ * @package System.I18N */ @@ -24,16 +18,16 @@ Prado::using('System.I18N.TTranslate'); /** * TChoiceFormat class. - * + * * This component performs message/string choice translation. The translation - * source is set in the TGlobalization handler. The following example - * demonstrated a simple 2 choice message translation. + * source is set in the TGlobalization module. The following example + * demonstrates a simple 2 choice message translation. * - * [1] One Apple. |[2] Two Apples + * [1] One Apple. |[2] Two Apples * * * The Choice has Value "1" (one), thus the translated string - * is "One Apple". If the Value was "2", then it will show + * is "One Apple". If the Value is "2", then it will show * "Two Apples". * * The message/string choices are separated by the pipe "|" followed @@ -41,17 +35,17 @@ Prado::using('System.I18N.TTranslate'); * # [1,2] -- accepts values between 1 and 2, inclusive. * # (1,2) -- accepts values between 1 and 2, excluding 1 and 2. * # {1,2,3,4} -- only values defined in the set are accepted. - * # [-Inf,0) -- accepts value greater or equal to negative infinity + * # [-Inf,0) -- 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 Value property. + * + * The string choosen for display depends on the Value property. * The Value is evaluated for each set until the Value is found * to belong to a particular set. * * Properties - * - Value, float, + * - Value, float, *
Gets or sets the Value that determines which string choice to display. * * @author Xiang Wei Zhuo @@ -63,7 +57,7 @@ class TChoiceFormat extends TTranslate /** * @return float the numerical value. */ - function getValue() + public function getValue() { return $this->getViewState('Value',''); } @@ -72,14 +66,14 @@ class TChoiceFormat extends TTranslate * Sets the numerical choice value * @param float the choice value */ - function setValue($value) + public function setValue($value) { $this->setViewState('Value',$value,''); } /** * Display the choosen translated string. - * Overrides the parent method, also calls parent's renderBody to + * Overrides the parent method, also calls parent's renderBody to * translate. */ protected function translateText($text, $subs) @@ -88,7 +82,7 @@ class TChoiceFormat extends TTranslate $choice = new ChoiceFormat(); $value = $this->getValue(); $string = $choice->format($text, $value); - if($string) + if($string) return strtr($string, array('{Value}'=> $value)); } } -- cgit v1.2.3