summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Advanced/I18N.page
diff options
context:
space:
mode:
authorxue <>2006-04-20 12:17:46 +0000
committerxue <>2006-04-20 12:17:46 +0000
commitf4a715e98befac72626b7d7a94f98882fee37c32 (patch)
tree7b849cbb9210d98bba234efdb42975ee5c342cc6 /demos/quickstart/protected/pages/Advanced/I18N.page
parent20f7dfe3340eb1ada7a96e4c24704ecb9445e8d9 (diff)
Fixed an inconsistency between tutorial and actual framework code.
Diffstat (limited to 'demos/quickstart/protected/pages/Advanced/I18N.page')
-rw-r--r--demos/quickstart/protected/pages/Advanced/I18N.page4
1 files changed, 2 insertions, 2 deletions
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)
<com:TTextHighlighter CssClass="source">
function clickMe($sender,$param)
{
- $sender->Text=localize("Hello, world!");
+ $sender->Text=Prado::localize("Hello, world!");
}
</com:TTextHighlighter>
@@ -129,7 +129,7 @@ $message = "There are " . $num_users . " users online.";
This problem can be solved using the <tt>localize</tt> function with string substitution. For example, the <tt>$message</tt> string above can be constructed as follows.
<com:TTextHighlighter CssClass="source">
$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));
</com:TTextHighlighter>
<p>Where the second parameter in <tt>localize</tt> takes an associative array with the key as the substitution to find in the text and replaced it with the associated value.
The <tt>localize</tt> function does not solve the problem of localizing languages that have plural forms, the solution is to use <a href="#choice-format">TChoiceFormat</a>.</p>