Changeset 2472

Show
Ignore:
Timestamp:
07/01/2008 10:14:40 AM (5 months ago)
Author:
mikl
Message:

Updated QST, added postgresql schema for I18N

Location:
trunk
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/demos/quickstart/protected/pages/Advanced/I18N.page

    r2377 r2472  
    7979Each translation message is wrapped within a <tt>trans-unit</tt> tag, where <tt>source</tt> is the original message, and <tt>target</tt> is the translated message. Editors such as <a href="http://www.heartsome.net/EN/xlfedit.html">Heartsome XLIFF Translation Editor</a> can help in editing these XML files. 
    8080 
     81<h2>Using a Database for translation</h2> 
     82 
     83<com:SinceVersion Version="3.1.3" /> 
     84<p>Since version 3.1.3 the messages can also be stored in a database using the connection id from an existing <tt>TDataSourceConfig</tt>. You have to create two tables in your database: <tt>catalogue</tt> and <tt>trans_unit</tt>. The catalogue table needs an entry for each catalogue you want to use. Example schemas for different databases can be found in the framework's <tt>I18N/schema</tt> directory. To configure translation with a database use:</> 
     85 
     86<com:TTextHighlighter Language="xml" CssClass="source block-content"> 
     87<module id="db1" class="System.Data.TDataSourceConfig"> 
     88    <database ConnectionString="mysql:host=localhost;dbname=demodb" Username="demo" Password="demo" /> 
     89</module> 
     90 
     91<module id="globalization" class="TGlobalization"> 
     92    <translation 
     93        type="Database" 
     94        autosave="true" 
     95        cache="false" 
     96        source="db1" /> 
     97</module> 
     98</com:TTextHighlighter> 
     99 
     100<p>The translation messages will be stored in the <tt>trans_unit</tt> table. Add your translation in the <tt>target</tt> field of that table. You should make sure that you are working on the right catalogue by comparing the message's <tt>cat_id</tt> with that from the catalogue table.</p> 
    81101 
    82102<h2 id="6206">Setting and Changing Culture</h2>