Show
Ignore:
Timestamp:
07/01/2008 08:45:46 AM (6 months ago)
Author:
mikl
Message:

Minor fixes in I18N MessageSource?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/framework/I18N/core/MessageSource.php

    r2470 r2471  
    3535 * 
    3636 *  # XLIFF -- using XML XLIFF format to store the translation messages. 
    37  *  # SQLite -- Store the translation messages in a SQLite database. 
    38  *  # MySQL -- Using a MySQL database to store the messages. 
    3937 *  # gettext -- Translated messages are stored in the gettext format. 
     38 *  # Database -- Use an existing TDbConnection to store the messages. 
     39 *  # SQLite -- (Deprecated) Store the translation messages in a SQLite database. 
     40 *  # MySQL -- (Deprecated) Using a MySQL database to store the messages. 
    4041 * 
    4142 * A custom message source can be instantiated by specifying the filename 
     
    5152 * See also the existing message source types as examples. 
    5253 *  
    53  * The following example instantiates a MySQL message source, set the culture, 
     54 * The following example instantiates a Database message source, set the culture, 
    5455 * set the cache handler, and use the source in a message formatter.  
    55  * The messages are store in a database named "messages". The source parameter 
    56  * for the actory method is a PEAR DB style DSN. 
     56 * The messages are stored using an existing connection. The source parameter 
     57 * for the factory method must contain a valid ConnectionID. 
    5758 * <code> 
    58  *   $dsn = 'mysql://username:password@localhost/messages'; 
    59  *   $source = MessageSource::factory('MySQL', $dsn); 
     59 *   // db1 must be already configured 
     60 *   $source = MessageSource::factory('Database', 'db1'); 
    6061 *    
    6162 *   //set the culture and cache, store the cache in the /tmp directory. 
     
    113114     * For 'gettext' and 'XLIFF', 'source' should point to the directory  
    114115     * where the messages are stored.  
    115      * For 'Database', 'source' should be a valid connection id. 
    116      * If (deprecated) 'MySQL' is used, 'source' must contain a valid  
    117      * DSN. 
     116     * For 'Database', 'source' must be a valid connection id. 
     117     * If one of the deprecated types 'MySQL' or 'SQLite' is used,  
     118     * 'source' must contain a valid  DSN. 
    118119         * 
    119120         * Custom message source are possible by supplying the a filename parameter 
     
    128129        static function &factory($type, $source='.', $filename='') 
    129130        { 
    130                 $types = array('XLIFF', 'MySQL', 'Database', 'gettext'); 
     131                $types = array('XLIFF','gettext','Database','MySQL','SQLite'); 
    131132                 
    132133                if(empty($filename) && !in_array($type, $types))