From d88930d23f712f9b9da279f32ee689e6d719f13b Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 15 Feb 2008 01:09:36 +0000 Subject: update docs on TChoiceFormat --- framework/I18N/core/ChoiceFormat.php | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'framework/I18N/core') diff --git a/framework/I18N/core/ChoiceFormat.php b/framework/I18N/core/ChoiceFormat.php index d36ab57b..b8eb69f0 100644 --- a/framework/I18N/core/ChoiceFormat.php +++ b/framework/I18N/core/ChoiceFormat.php @@ -41,14 +41,37 @@ * * The message/string choices are separated by the pipe "|" followed * by a set notation of the form - * # [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 + * # [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 * and strictly less than 0 * Any non-empty combinations of the delimiters of square and round brackets * are acceptable. * + * Since version 3.1.2 the following set notation is also possible. + * + * # {n: n % 10 > 1 && n % 10 < 5} -- matches numbers like 2, 3, 4, 22, 23, 24 + * + * Where set is defined by the expression after n:. In particular, the expression + * accepts the following mathematical/logical operators to form a set of logical conditions + * on the value given by n: + * # < -- less than. + * # <= -- less than equals. + * # > -- greater than. + * # >= -- greater than equals. + * # == -- of equal value. + * # % -- modulo, e.g., 1 % 10 equals 1, 11 % 10 equals 1. + * # - -- minus, negative. + * # + -- addition. + * # & -- conditional AND. + * # && -- condition AND with short circuit. + * # | -- conditional OR. + * # || -- conditional OR with short circuit. + * # ! -- negation. + * + * Additional round brackets can also be used to perform grouping. + * * @author Xiang Wei Zhuo * @version v1.0, last update on Fri Dec 24 20:46:16 EST 2004 * @package System.I18N.core @@ -200,4 +223,4 @@ class ChoiceFormat } } -?> \ No newline at end of file +?> -- cgit v1.2.3