Changeset 2470
- Timestamp:
- 06/30/2008 12:04:42 PM (3 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 modified
-
HISTORY (modified) (1 diff)
-
UPGRADE (modified) (1 diff)
-
framework/Exceptions/messages/messages.txt (modified) (1 diff)
-
framework/I18N/TGlobalization.php (modified) (1 diff)
-
framework/I18N/core/MessageSource.php (modified) (3 diffs)
-
framework/I18N/core/MessageSource_Database.php (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/HISTORY
r2468 r2470 11 11 BUG: Ticket#872 - use PATH_SEPARATOR in phpunit.php (fragmaster b) 12 12 ENH: Added Prado.Validation.validateControl(id) on client side to validate a specific control (Michael) 13 ENH: Added MessageSource_Database to I18N (uses TDbConnection) (Michael) 13 14 14 15 Version 3.1.2 April 21, 2008 -
trunk/UPGRADE
r2449 r2470 12 12 Upgrading from v3.1.2 13 13 --------------------- 14 - The Translation configuration now also accepts type 'Database' to 15 ease the setup of DB base translation. A valid ConnectionID has to 16 be supplied in the source parameter: 17 <translation type="Database" source="db1" autosave="true" cache="false" /> 18 Type 'MySQL' can still be used but is deprecated and might be removed 19 in a later release. 14 20 15 21 -
trunk/framework/Exceptions/messages/messages.txt
r2445 r2470 350 350 globalization_cache_path_failed = Unable to create translation message cache path '{0}'. Make sure the parent directory exists and is writable by the Web process. 351 351 globalization_source_path_failed = Unable to create translation message path '{0}'. Make sure the parent directory exists and is writable by the Web process. 352 messagesource_connectionid_invalid = MessageSource_Database.source '{0}' does not point to a valid TDataSourceConfig module. 353 messagesource_connectionid_required = ConnectionID in MessageSource_Database.source is required. 354 352 355 callback_not_support_no_priority_state_update = Callback request does not support unprioritized pagestate update. 353 356 callback_invalid_callback_options = '{1}' is not a valid TCallbackOptions control for Callback control '{0}'. -
trunk/framework/I18N/TGlobalization.php
r2112 r2470 156 156 * Sets the translation configuration. Example configuration: 157 157 * <code> 158 * $config['type'] = 'XLIFF'; //XLIFF, gettext, mysql or sqlite 159 * $config['source'] = 'Path.to.directory'; //or database connection string 158 * $config['type'] = 'XLIFF'; //XLIFF, gettext, Database or MySQL (deprecated) 159 * $config['source'] = 'Path.to.directory'; // for types XLIFF and gettext 160 * $config['source'] = 'connectionId'; // for type Database 161 * $config['source'] = 'mysql://user:pw@host/db'; // for type MySQL (deprecated) 160 162 * $config['catalogue'] = 'messages'; //default catalog 161 163 * $config['autosave'] = 'true'; //save untranslated message -
trunk/framework/I18N/core/MessageSource.php
r1398 r2470 109 109 /** 110 110 * Factory method to instantiate a new MessageSource depending on the 111 * source type. The allowed source types are 'XLIFF', 'SQLite', 112 * 'MySQL', and 'gettext'. The source parameter is dependent on the 113 * source type. For 'gettext' and 'XLIFF', it should point to the directory 114 * where the messages are stored. For database types, e.g. 'SQLite' and 115 * 'MySQL', it should be a PEAR DB style DSN string. 111 * source type. The allowed source types are 'XLIFF', 'gettext' and 112 * 'Database'. The source parameter depends on the source type. 113 * For 'gettext' and 'XLIFF', 'source' should point to the directory 114 * 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 118 * 117 119 * Custom message source are possible by supplying the a filename parameter … … 119 121 * 120 122 * @param string the message source type. 121 * @param string the location of the resource .123 * @param string the location of the resource or the ConnectionID. 122 124 * @param string the filename of the custom message source. 123 125 * @return MessageSource a new message source of the specified type. … … 126 128 static function &factory($type, $source='.', $filename='') 127 129 { 128 $types = array('XLIFF', ' SQLite', 'MySQL', 'gettext');129 130 if(empty($filename) && in_array($type, $types) == false)130 $types = array('XLIFF', 'MySQL', 'Database', 'gettext'); 131 132 if(empty($filename) && !in_array($type, $types)) 131 133 throw new Exception('Invalid type "'.$type.'", valid types are '. 132 134 implode(', ', $types));
