Changeset 7839
- Timestamp:
- 03/12/08 21:43:57 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/i18n/sfMessageSource_XLIFF.class.php
r6807 r7839 21 21 /** 22 22 * sfMessageSource_XLIFF class. 23 * 23 * 24 24 * Using XML XLIFF format as the message source for translation. 25 25 * Details and example of XLIFF can be found in the following URLs. … … 27 27 * # http://www.opentag.com/xliff.htm 28 28 * # http://www-106.ibm.com/developerworks/xml/library/x-localis2/ 29 * 29 * 30 30 * See the MessageSource::factory() method to instantiate this class. 31 * 31 * 32 32 * @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com> 33 33 * @version v1.0, last update on Fri Dec 24 16:18:44 EST 2004 … … 39 39 /** 40 40 * Message data filename extension. 41 * @var string 41 * @var string 42 42 */ 43 43 protected $dataExt = '.xml'; … … 74 74 75 75 /** 76 * Creates and returns a new DOMDocument instance 77 * 78 * @return DOMDocument 79 */ 80 protected static function createDOMDocument() 81 { 82 $dom = new DOMDocument(); 83 $dom->formatOutput = true; 84 $dom->preserveWhiteSpace = false; 85 return $dom; 86 } 87 88 /** 76 89 * Gets the variant for a catalogue depending on the current culture. 77 90 * 78 91 * @param string catalogue 79 * @return string the variant. 92 * @return string the variant. 80 93 * @see save() 81 94 * @see update() … … 102 115 103 116 /** 104 * Saves the list of untranslated blocks to the translation source. 117 * Saves the list of untranslated blocks to the translation source. 105 118 * If the translation was not found, you should add those 106 119 * strings to the translation source via the <b>append()</b> method. … … 133 146 134 147 // create a new dom, import the existing xml 135 $dom = newDOMDocument();148 $dom = self::createDOMDocument(); 136 149 $dom->load($filename); 137 150 … … 211 224 212 225 // create a new dom, import the existing xml 213 $dom = newDOMDocument();226 $dom = self::createDOMDocument(); 214 227 $dom->load($filename); 215 228 … … 294 307 * @param string the source message to delete. 295 308 * @param string the catalogue to delete from. 296 * @return boolean true if deleted, false otherwise. 309 * @return boolean true if deleted, false otherwise. 297 310 */ 298 311 public function delete($message, $catalogue='messages') … … 314 327 315 328 // create a new dom, import the existing xml 316 $dom = newDOMDocument();329 $dom = self::createDOMDocument(); 317 330 $dom->load($filename); 318 331

