From c54a230a5926086ff1b69a0dd7e6352dbc0b40ff Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 20 Apr 2006 17:09:09 +0000 Subject: Merge from 3.0 branch till 947. --- demos/quickstart/protected/pages/Advanced/I18N.page | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'demos/quickstart/protected/pages/Advanced') diff --git a/demos/quickstart/protected/pages/Advanced/I18N.page b/demos/quickstart/protected/pages/Advanced/I18N.page index 75ee59ee..f37e5cf6 100644 --- a/demos/quickstart/protected/pages/Advanced/I18N.page +++ b/demos/quickstart/protected/pages/Advanced/I18N.page @@ -114,7 +114,7 @@ function clickMe($sender,$param) function clickMe($sender,$param) { - $sender->Text=localize("Hello, world!"); + $sender->Text=Prado::localize("Hello, world!"); } @@ -129,7 +129,7 @@ $message = "There are " . $num_users . " users online."; This problem can be solved using the localize function with string substitution. For example, the $message string above can be constructed as follows. $num_users = 12; -$message = localize("There are {num_users} users online.", array('num_users'=>$num_users)); +$message = Prado::localize("There are {num_users} users online.", array('num_users'=>$num_users));

Where the second parameter in localize takes an associative array with the key as the substitution to find in the text and replaced it with the associated value. The localize function does not solve the problem of localizing languages that have plural forms, the solution is to use TChoiceFormat.

-- cgit v1.2.3