Ticket #29254: makepot.diff
| File makepot.diff, 3.2 KB (added by , 12 years ago) |
|---|
-
src/wp-includes/pomo/po.php
97 97 * @param string $string the string to format 98 98 * @return string the poified string 99 99 */ 100 function poify($string) {100 static function poify($string) { 101 101 $quote = '"'; 102 102 $slash = '\\'; 103 103 $newline = "\n"; … … 160 160 * @param string $string prepend lines in this string 161 161 * @param string $with prepend lines with this string 162 162 */ 163 function prepend_each_line($string, $with) {163 static function prepend_each_line($string, $with) { 164 164 $php_with = var_export($with, true); 165 165 $lines = explode("\n", $string); 166 166 // do not prepend the string on the last empty line, artefact by explode … … 180 180 * @param string $char character to denote a special PO comment, 181 181 * like :, default is a space 182 182 */ 183 function comment_block($text, $char=' ') {183 static function comment_block($text, $char=' ') { 184 184 $text = wordwrap($text, PO_MAX_LINE_LEN - 3); 185 185 return PO::prepend_each_line($text, "#$char "); 186 186 } … … 193 193 * @return string|bool PO-style formatted string for the entry or 194 194 * false if the entry is empty 195 195 */ 196 function export_entry(&$entry) {196 public static function export_entry(&$entry) { 197 197 if (is_null($entry->singular)) return false; 198 198 $po = array(); 199 199 if (!empty($entry->translator_comments)) $po[] = PO::comment_block($entry->translator_comments); -
tools/i18n/extract.php
28 28 foreach ( $file_names as $file_name ) { 29 29 if ( '.' == $file_name || '..' == $file_name ) continue; 30 30 if ( preg_match( '/\.php$/', $file_name ) && $this->does_file_name_match( $prefix . $file_name, $excludes, $includes ) ) { 31 $translations->merge_originals_with( $this->extract_from_file( $file_name, $prefix ) ); 31 $extracted = $this->extract_from_file( $file_name, $prefix ); 32 } elseif ( is_dir( $file_name ) ) { 33 $extracted = $this->extract_from_directory( $file_name, $excludes, $includes, $prefix . $file_name . '/' ); 34 } else { 35 continue; 32 36 } 33 if ( is_dir( $file_name ) ) { 34 $translations->merge_originals_with( $this->extract_from_directory( $file_name, $excludes, $includes, $prefix . $file_name . '/' ) ); 35 } 37 38 $translations->merge_originals_with( $extracted ); 36 39 } 37 40 chdir( $old_cwd ); 38 41 return $translations; -
tools/i18n/makepot.php
388 388 389 389 } 390 390 391 function get_first_lines($filename, $lines = 30) {391 public static function get_first_lines($filename, $lines = 30) { 392 392 $extf = fopen($filename, 'r'); 393 393 if (!$extf) return false; 394 394 $first_lines = ''; … … 404 404 } 405 405 406 406 407 function get_addon_header($header, &$source) {407 public static function get_addon_header($header, &$source) { 408 408 if (preg_match('|'.$header.':(.*)$|mi', $source, $matches)) 409 409 return trim($matches[1]); 410 410 else
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)