Development

Changeset 7839

You must first sign up to be able to contribute.

Changeset 7839

Show
Ignore:
Timestamp:
03/12/08 21:43:57 (2 years ago)
Author:
dwhittle
Message:

1.1: fixed xliff files are not indented (thanks nicolas - closes #3102)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/i18n/sfMessageSource_XLIFF.class.php

    r6807 r7839  
    2121/** 
    2222 * sfMessageSource_XLIFF class. 
    23  *  
     23 * 
    2424 * Using XML XLIFF format as the message source for translation. 
    2525 * Details and example of XLIFF can be found in the following URLs. 
     
    2727 * # http://www.opentag.com/xliff.htm 
    2828 * # http://www-106.ibm.com/developerworks/xml/library/x-localis2/ 
    29  *  
     29 * 
    3030 * See the MessageSource::factory() method to instantiate this class. 
    31  *  
     31 * 
    3232 * @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com> 
    3333 * @version v1.0, last update on Fri Dec 24 16:18:44 EST 2004 
     
    3939  /** 
    4040   * Message data filename extension. 
    41    * @var string  
     41   * @var string 
    4242   */ 
    4343  protected $dataExt = '.xml'; 
     
    7474 
    7575  /** 
     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  /** 
    7689   * Gets the variant for a catalogue depending on the current culture. 
    7790   * 
    7891   * @param string catalogue 
    79    * @return string the variant.  
     92   * @return string the variant. 
    8093   * @see save() 
    8194   * @see update() 
     
    102115 
    103116  /** 
    104    * Saves the list of untranslated blocks to the translation source.  
     117   * Saves the list of untranslated blocks to the translation source. 
    105118   * If the translation was not found, you should add those 
    106119   * strings to the translation source via the <b>append()</b> method. 
     
    133146 
    134147    // create a new dom, import the existing xml 
    135     $dom = new DOMDocument(); 
     148    $dom = self::createDOMDocument(); 
    136149    $dom->load($filename); 
    137150 
     
    211224 
    212225    // create a new dom, import the existing xml 
    213     $dom = new DOMDocument(); 
     226    $dom = self::createDOMDocument(); 
    214227    $dom->load($filename); 
    215228 
     
    294307   * @param string the source message to delete. 
    295308   * @param string the catalogue to delete from. 
    296    * @return boolean true if deleted, false otherwise.  
     309   * @return boolean true if deleted, false otherwise. 
    297310   */ 
    298311  public function delete($message, $catalogue='messages') 
     
    314327 
    315328    // create a new dom, import the existing xml 
    316     $dom = new DOMDocument(); 
     329    $dom = self::createDOMDocument(); 
    317330    $dom->load($filename); 
    318331 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.