[ Index ] |
|
Code source de PRADO 3.0.6 |
1 <%@ Title="Internationlization in PRADO" 2 Page.Application.Globalization.TranslationCatalogue="index" %> 3 <com:TContent ID="body"> 4 5 <h1>Internationlization in PRADO</h1> 6 <p>This demo shows the basic components available in PRADO for the process of Internationalizing and Localizing web applications. This page utilize multiple locale (or culture) aware templates to show the appropriate localized page. To view a different localized version, please change your language settings in your browser.</p> 7 8 <p> 9 Your current culture is <%= $this->Page->CurrentCulture %>. 10 <div class="links"> 11 Available localized versions: 12 <com:LanguageList /> 13 </div> 14 </p> 15 16 <p> 17 In addition to culture aware template. Text can be localized using many different translation sources. PRADO provides gettext, XML, SQLite, and MySQL container for storing message translations. The example in the following link demonstrates how text can be localized using the TTranslate component. 18 </p> 19 <hr /> 20 <h2>Introduction</h2> 21 <p> Developing and maintaining multi-language sites is a common problem for web developers. </p> 22 <dl> 23 <dt><strong>Internationalization (I18N)</strong></dt> 24 <dd>Process of developing a product in such a way that it works with data in different languages and can be adapted to various target markets without engineering changes. </dd> 25 <dt><strong>Localization (L10N)</strong></dt> 26 <dd>Subsequent process of translating and adapting a product to a given market's cultural conventions.</dd> 27 </dl> 28 <p>The following features are supported by PRADO: </p> 29 <ul> 30 <li>Text translation</li> 31 <li>Attribute translation</li> 32 <li>Parameter substitution (with translation if needed) </li> 33 <li>Date, number and currency formatting </li> 34 </ul> 35 <h2>Examples</h2> 36 <h3>Date: full pattern, en_GB culture</h3> 37 <h4>Example:</h4> 38 <com:TTextHighlighter Language="prado" CssClass="source"> 39 <com:TDateFormat ID="Time1" Pattern="full" Culture="en_GB"/> 40 </com:TTextHighlighter> 41 <h4>Result:</h4> 42 <com:TDateFormat ID="Time1" Pattern="full" Culture="en_GB"/> <br /> 43 <hr /> 44 45 <h3>Date: short pattern</h3> 46 <h4>Example:</h4> 47 <com:TTextHighlighter Language="prado" CssClass="source"> 48 <com:TDateFormat ID="Time2" Pattern="short" /> 49 </com:TTextHighlighter> 50 51 <h4>Result:</h4> 52 <com:TDateFormat ID="Time2" Pattern="short" /> <br /> 53 <hr /> 54 55 <h3>Date default pattern of <%= $this->Page->CurrentCulture %> </h3> 56 <h4>Example:</h4> 57 <com:TTextHighlighter Language="prado" CssClass="source"> 58 <com:TDateFormat ID="Time3" Value="2004/12/06" /> 59 </com:TTextHighlighter> 60 61 <h4>Result:</h4> 62 <com:TDateFormat ID="Time3" Value="2004/12/06" /> <br /> 63 <hr /> 64 65 <h3>Currency default format</h3> 66 <h4>Example:</h4> 67 <com:TTextHighlighter Language="prado" CssClass="source"> 68 <com:TNumberFormat Type="currency" Value="12.4" /> 69 </com:TTextHighlighter> 70 71 <h4>Result:</h4> 72 <com:TNumberFormat Type="currency" Value="12.4" /> <br /> 73 <hr /> 74 <h3>Currency, de_DE culture with Euro</h3> 75 <h4>Example:</h4> 76 <com:TTextHighlighter Language="prado" CssClass="source"> 77 <com:TNumberFormat ID="Number2" Type="currency" Culture="de_DE" Currency="EUR"/> 78 </com:TTextHighlighter> 79 80 <h4>Result:</h4> 81 <com:TNumberFormat ID="Number2" Type="currency" Culture="de_DE" Currency="EUR"/> <br /> 82 83 <hr /> 84 85 <h3>Currency, US format with Euro</h3> 86 <h4>Example:</h4> 87 <com:TTextHighlighter Language="prado" CssClass="source"> 88 <com:TNumberFormat Type="currency" Culture="en_US" Currency="EUR" Value="100" /> 89 </com:TTextHighlighter> 90 91 <h4>Result</h4> 92 <com:TNumberFormat Type="currency" Culture="en_US" Currency="EUR" Value="100" /> <br /> 93 <hr /> 94 95 <h3>Translation examples</h3> 96 <h4>Example:</h4> 97 <com:TTextHighlighter Language="prado" CssClass="source"> 98 <com:TTranslate>Hello</com:TTranslate> 99 </com:TTextHighlighter> 100 101 <h4>Result:</h4> 102 <com:TTranslate>Hello</com:TTranslate> <br /> 103 <h4>Example:</h4> 104 <com:TTextHighlighter Language="prado" CssClass="source"> 105 <com:TTranslate Text="Goodbye" /> 106 </com:TTextHighlighter> 107 108 <h4>Result:</h4> 109 <com:TTranslate Text="Goodbye" /> <br /> 110 111 <hr /> 112 <h3>Using localization tag</h3> 113 <h4>Example:</h4> 114 <com:TTextHighlighter Language="prado" CssClass="source"> 115 <%[ Goodbye ]%> 116 </com:TTextHighlighter> 117 118 <h4>Result:</h4> 119 <%[ Goodbye ]%> 120 <br /> 121 122 123 <hr /> 124 <h3>Translation using a different catalogue </h3> 125 <h4>Example:</h4> 126 <com:TTextHighlighter Language="prado" CssClass="source"> 127 <com:TTranslate Text="Goodbye" Catalogue="tests" /> 128 </com:TTextHighlighter> 129 130 <h4>Result:</h4> 131 <com:TTranslate Text="Goodbye" Catalogue="tests" /> 132 <br /> 133 134 135 <hr /> 136 <h3>Translation with parameter substitution</h3> 137 <h4>Example:</h4> 138 <com:TTextHighlighter Language="prado" CssClass="source"> 139 <com:TTranslate> 140 {greeting} {name}!, The unix-time is "{time}". 141 <com:TTranslateParameter Key="name"> 142 <com:TTranslate Catalogue="tests" Text="World" /> 143 </com:TTranslateParameter> 144 <com:TTranslateParameter Key="greeting" Value="Hello" /> 145 <com:TTranslateParameter Key="time" Value="<%= Time() %>" /> 146 </com:TTranslate> 147 </com:TTextHighlighter> 148 149 150 <h4>Result:</h4> 151 152 <com:TTranslate> 153 {greeting} {name}!, The unix-time is "{time}". 154 <com:TTranslateParameter Key="name"> 155 <com:TTranslate Catalogue="tests" Text="World" /> 156 </com:TTranslateParameter> 157 <com:TTranslateParameter Key="greeting" Value="Hello" /> 158 <com:TTranslateParameter Key="time" Value="<%= Time() %>" /> 159 </com:TTranslate> 160 161 </com:TContent>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 21:07:04 2007 | par Balluche grâce à PHPXref 0.7 |