From af68030fcf0c266300feb2c100149ecadef7d364 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sun, 16 Jul 2006 01:50:23 +0000 Subject: Merge from 3.0 branch till 1264. --- .../quickstart/protected/pages/Advanced/I18N.page | 52 +++++++++++----------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'demos/quickstart/protected/pages/Advanced/I18N.page') diff --git a/demos/quickstart/protected/pages/Advanced/I18N.page b/demos/quickstart/protected/pages/Advanced/I18N.page index 6c86a6c9..1330091f 100644 --- a/demos/quickstart/protected/pages/Advanced/I18N.page +++ b/demos/quickstart/protected/pages/Advanced/I18N.page @@ -18,7 +18,7 @@
  • Dates, Times.
  • Numbers, Currency, Measurements.
  • Phone numbers.
  • -
  • Honorifics and personal titles.
  • +
  • Honorific and personal titles.
  • Postal address.
  • Page layout.
  • @@ -26,7 +26,7 @@

    If possible all manner of text should be isolated and store in a persistence format. These text include, application error messages, hard coded strings in PHP files, emails, static HTML text, and text on form elements (e.g. buttons).

    Configuration

    -

    To enable the localization features in Prado, you need to add a few configuration options in your application configuration. +

    To enable the localization features in PRADO, you need to add a few configuration options in your application configuration. First you need to include the System.I18N.* namespace to your paths.

    @@ -98,7 +98,7 @@ Lastly, you can change the globalization settings on page by page basis using -

    Localizing your Prado application

    +

    Localizing your PRADO application

    There are two areas in your application that may need message or string localization, in PHP code and in the templates. To localize strings within PHP, use the localize function detailed below. To localize text in the template, use the
    TTranslate component.

    Using localize function to translate text within PHP

    @@ -134,7 +134,7 @@ $message = Prado::localize("There are {num_users} users online.", array('num_use

    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.

    -

    The following sample demonstrates the basics of localization in Prado.

    +

    The following sample demonstrates the basics of localization in PRADO.

    I18N Components

    @@ -148,9 +148,9 @@ To translate a message or string in the template, use TTranslate.

    <com:TTranslate Text="Goodbye" />
    -

    TTranslate can also perform string substitution. +

    TTranslate can also perform string substitution. The Parameters property can be use to add name values pairs for substitution. Substrings in the translation enclosed with "{" and "}" are consider as the - parameter names during substitution lookup. The following example will substitute the substring "{time}" with the value of the parameter attribute "Parameters.time=<%= time() %>". + parameter names during substitution lookup. The following example will substitute the substring "{time}" with the value of the parameter attribute "Parameters.time=<%= time() %>". <com:TTranslate Parameters.time=<%= time() %> > The time is {time}. @@ -183,17 +183,17 @@ The time is {time}.

  • mediumtime
  • shorttime
  • -The predefined can be used in any combination. If using a combined predefined pattern, -the first pattern must be the date, followed by a space, and lastly the time pattern. -For example, full date pattern with short time pattern. The actual ordering of the -date-time and the actual pattern will be determine automatically from locale data specified +The predefined can be used in any combination. If using a combined predefined pattern, +the first pattern must be the date, followed by a space, and lastly the time pattern. +For example, full date pattern with short time pattern. The actual ordering of the +date-time and the actual pattern will be determine automatically from locale data specified by the Culture property.

    <com:TDateFormat Pattern="fulldate shorttime" /> -

    You can also specify a custom pattern using the following sub-patterns. +

    You can also specify a custom pattern using the following sub-patterns. The date/time format is specified by means of a string time pattern. In this pattern, all ASCII letters are reserved as pattern letters, which are defined as the following: Symbol Meaning Presentation Example @@ -222,22 +222,22 @@ The date/time format is specified by means of a string time pattern. In this pat

    The count of pattern letters determine the format.

    -

    (Text): 4 letters uses full form, less than 4, use short or abbreviated form +

    (Text): 4 letters uses full form, less than 4, use short or abbreviated form if it exists. (e.g., "EEEE" produces "Monday", "EEE" produces "Mon")

    (Number): the minimum number of digits. Shorter numbers are zero-padded - to this amount (e.g. if "m" produces "6", "mm" produces "06"). Year is - handled specially; that is, if the count of 'y' is 2, the Year will be - truncated to 2 digits. (e.g., if "yyyy" produces "1997", "yy" produces "97".) + to this amount (e.g. if "m" produces "6", "mm" produces "06"). Year is + handled specially; that is, if the count of 'y' is 2, the Year will be + truncated to 2 digits. (e.g., if "yyyy" produces "1997", "yy" produces "97".) Unlike other fields, fractional seconds are padded on the right with zero.

    -

    (Text and Number): 3 or over, use text, otherwise use number. (e.g., -"M" produces "1", "MM" produces "01", "MMM" produces "Jan", and "MMMM" +

    (Text and Number): 3 or over, use text, otherwise use number. (e.g., +"M" produces "1", "MM" produces "01", "MMM" produces "Jan", and "MMMM" produces "January".)

    -

    Any characters in the pattern that are not in the ranges of ['a'..'z'] -and ['A'..'Z'] will be treated as quoted text. For instance, characters -like ':', '.', ' ', and '@' will appear in the resulting time text +

    Any characters in the pattern that are not in the ranges of ['a'..'z'] +and ['A'..'Z'] will be treated as quoted text. For instance, characters +like ':', '.', ' ', and '@' will appear in the resulting time text even they are not embraced within single quotes.

    Examples using the US locale: @@ -259,7 +259,7 @@ Format Pattern Result

    TNumberFormat

    PRADO's Internationalization framework provide localized currency formatting and number formatting. Please note that the TNumberFormat component provides formatting only, it does not perform current conversion or exchange.

    -

    Numbers can be formatted as currency, percentage, decimal or scientific +

    Numbers can be formatted as currency, percentage, decimal or scientific numbers by specifying the Type attribute. The valid types are:

    - + <com:TNumberFormat Type="currency" Value="100" /> @@ -283,13 +283,13 @@ then also from the de_DE locale. This may lead to some confusion becaus people from US uses the "," (comma) as thousand separator. Therefore a Currency attribute is available, so that the output from the following example results in $100.00 -<com:TNumberFormat Type="currency" +<com:TNumberFormat Type="currency" Culture="en_US" Currency="EUR" Value="100" />

    -

    The Pattern property determines the number of digits, thousand grouping -positions, the number of decimal points and the decimal position. The actual characters that +

    The Pattern property determines the number of digits, thousand grouping +positions, the number of decimal points and the decimal position. The actual characters that are used to represent the decimal points and thousand points are culture specific and will change automatically according to the Culture property. The valid Pattern characters are: @@ -299,7 +299,7 @@ and will change automatically according to the Culture property. The va

  • . (full stop) - the position of the decimal point (only 1 decimal point is allowed)
  • , (comma) - thousand point separation (up to 2 commas are allowed)
  • -For example, consider the Value="1234567.12345" and +For example, consider the Value="1234567.12345" and with Culture="en_US" (which uses "," for thousand point separator and "." for decimal separators). Pattern Output -- cgit v1.2.3