web/wp-includes/pomo/po.php
branchwordpress
changeset 132 4d4862461b8d
parent 109 03b0d1493584
equal deleted inserted replaced
131:a4642baaf829 132:4d4862461b8d
     1 <?php
     1 <?php
     2 /**
     2 /**
     3  * Class for working with PO files
     3  * Class for working with PO files
     4  *
     4  *
     5  * @version $Id: po.php 123 2009-05-13 19:35:43Z nbachiyski $
     5  * @version $Id: po.php 283 2009-09-23 16:21:51Z nbachiyski $
     6  * @package pomo
     6  * @package pomo
     7  * @subpackage po
     7  * @subpackage po
     8  */
     8  */
     9 
     9 
    10 require_once dirname(__FILE__) . '/translations.php';
    10 require_once dirname(__FILE__) . '/translations.php';
    14 ini_set('auto_detect_line_endings', 1);
    14 ini_set('auto_detect_line_endings', 1);
    15 
    15 
    16 /**
    16 /**
    17  * Routines for working with PO files
    17  * Routines for working with PO files
    18  */
    18  */
       
    19 if ( !class_exists( 'PO' ) ):
    19 class PO extends Gettext_Translations {
    20 class PO extends Gettext_Translations {
    20 	
    21 	
    21 
    22 
    22 	/**
    23 	/**
    23 	 * Exports headers to a PO entry
    24 	 * Exports headers to a PO entry
   314 				}
   315 				}
   315 			} else {
   316 			} else {
   316 				return false;
   317 				return false;
   317 			}
   318 			}
   318 		}
   319 		}
   319 		if (array() == array_filter($entry->translations)) $entry->translations = array();
   320 		if (array() == array_filter($entry->translations, create_function('$t', 'return $t || "0" === $t;'))) {
       
   321 			$entry->translations = array();
       
   322 		}
   320 		return array('entry' => $entry, 'lineno' => $lineno);
   323 		return array('entry' => $entry, 'lineno' => $lineno);
   321 	}
   324 	}
   322 	
   325 	
   323 	function read_line($f, $action = 'read') {
   326 	function read_line($f, $action = 'read') {
   324 		static $last_line = '';
   327 		static $last_line = '';
   355 		if ( substr($s, 0, 1) == '"') $s = substr($s, 1);
   358 		if ( substr($s, 0, 1) == '"') $s = substr($s, 1);
   356 		if ( substr($s, -1, 1) == '"') $s = substr($s, 0, -1);
   359 		if ( substr($s, -1, 1) == '"') $s = substr($s, 0, -1);
   357 		return $s;
   360 		return $s;
   358 	}
   361 	}
   359 }
   362 }
   360 ?>
   363 endif;