@@ -152,6 +152,9 @@ discard block |
||
152 | 152 | unlink( $temp_file ); |
153 | 153 | } |
154 | 154 | |
155 | + /** |
|
156 | + * @param string $file |
|
157 | + */ |
|
155 | 158 | function tempnam( $file ) { |
156 | 159 | $tempnam = tempnam( sys_get_temp_dir(), $file ); |
157 | 160 | $this->temp_files[] = $tempnam; |
@@ -231,6 +234,9 @@ discard block |
||
231 | 234 | return $res; |
232 | 235 | } |
233 | 236 | |
237 | + /** |
|
238 | + * @param string $output |
|
239 | + */ |
|
234 | 240 | function wp_core($dir, $output) { |
235 | 241 | if ( file_exists( "$dir/wp-admin/user/about.php" ) ) return false; |
236 | 242 | |
@@ -241,6 +247,9 @@ discard block |
||
241 | 247 | ) ); |
242 | 248 | } |
243 | 249 | |
250 | + /** |
|
251 | + * @param string $output |
|
252 | + */ |
|
244 | 253 | function wp_frontend($dir, $output) { |
245 | 254 | if ( ! file_exists( "$dir/wp-admin/user/about.php" ) ) return false; |
246 | 255 | |
@@ -251,6 +260,9 @@ discard block |
||
251 | 260 | ) ); |
252 | 261 | } |
253 | 262 | |
263 | + /** |
|
264 | + * @param string $output |
|
265 | + */ |
|
254 | 266 | function wp_admin($dir, $output) { |
255 | 267 | if ( ! file_exists( "$dir/wp-admin/user/about.php" ) ) return false; |
256 | 268 |
@@ -51,6 +51,9 @@ discard block |
||
51 | 51 | return ''; |
52 | 52 | } |
53 | 53 | |
54 | + /** |
|
55 | + * @param string $dir |
|
56 | + */ |
|
54 | 57 | function list_php_files($dir) { |
55 | 58 | $files = array(); |
56 | 59 | $items = scandir( $dir ); |
@@ -67,16 +70,25 @@ discard block |
||
67 | 70 | } |
68 | 71 | |
69 | 72 | |
73 | + /** |
|
74 | + * @param string $global_array_name |
|
75 | + */ |
|
70 | 76 | function make_string_aggregator($global_array_name, $filename) { |
71 | 77 | $a = $global_array_name; |
72 | 78 | return create_function('$string, $comment_id, $line_number', 'global $'.$a.'; $'.$a.'[] = array($string, $comment_id, '.var_export($filename, true).', $line_number);'); |
73 | 79 | } |
74 | 80 | |
81 | + /** |
|
82 | + * @param string $global_mo_name |
|
83 | + */ |
|
75 | 84 | function make_mo_replacer($global_mo_name) { |
76 | 85 | $m = $global_mo_name; |
77 | 86 | return create_function('$token, $string', 'global $'.$m.'; return var_export($'.$m.'->translate($string), true);'); |
78 | 87 | } |
79 | 88 | |
89 | + /** |
|
90 | + * @param string $register_action |
|
91 | + */ |
|
80 | 92 | function walk_tokens(&$tokens, $string_action, $other_action, $register_action=null) { |
81 | 93 | |
82 | 94 | $current_comment_id = ''; |
@@ -99,6 +99,9 @@ discard block |
||
99 | 99 | return true; |
100 | 100 | } |
101 | 101 | |
102 | + /** |
|
103 | + * @return string |
|
104 | + */ |
|
102 | 105 | function export_original($entry) { |
103 | 106 | //TODO: warnings for control characters |
104 | 107 | $exported = $entry->singular; |
@@ -137,6 +140,9 @@ discard block |
||
137 | 140 | } |
138 | 141 | } |
139 | 142 | |
143 | + /** |
|
144 | + * @param POMO_FileReader $reader |
|
145 | + */ |
|
140 | 146 | function import_from_reader($reader) { |
141 | 147 | $endian_string = MO::get_byteorder($reader->readint32()); |
142 | 148 | if (false === $endian_string) { |
@@ -85,6 +85,7 @@ discard block |
||
85 | 85 | * Text to include as a comment before the start of the PO contents |
86 | 86 | * |
87 | 87 | * Doesn't need to include # in the beginning of lines, these are added automatically |
88 | + * @param string $text |
|
88 | 89 | */ |
89 | 90 | function set_comment_before_headers( $text ) { |
90 | 91 | $this->comments_before_headers = $text; |
@@ -190,7 +191,8 @@ discard block |
||
190 | 191 | * |
191 | 192 | * @static |
192 | 193 | * @param object &$entry the entry to convert to po string |
193 | - * @return string|bool PO-style formatted string for the entry or |
|
194 | + * @param Translation_Entry $entry |
|
195 | + * @return false|string PO-style formatted string for the entry or |
|
194 | 196 | * false if the entry is empty |
195 | 197 | */ |
196 | 198 | public static function export_entry(&$entry) { |
@@ -362,6 +364,9 @@ discard block |
||
362 | 364 | return $line; |
363 | 365 | } |
364 | 366 | |
367 | + /** |
|
368 | + * @param string $po_comment_line |
|
369 | + */ |
|
365 | 370 | function add_comment_to_entry(&$entry, $po_comment_line) { |
366 | 371 | $first_two = substr($po_comment_line, 0, 2); |
367 | 372 | $comment = trim(substr($po_comment_line, 2)); |
@@ -9,6 +9,9 @@ discard block |
||
9 | 9 | return $translations->translate($text); |
10 | 10 | } |
11 | 11 | |
12 | +/** |
|
13 | + * @param string $text |
|
14 | + */ |
|
12 | 15 | function _e($text, $domain = 'default') { |
13 | 16 | $translations = &get_translations($domain); |
14 | 17 | echo $translations->translate($text); |
@@ -35,11 +38,18 @@ discard block |
||
35 | 38 | $translations = array(); |
36 | 39 | $empty_translations = & new Translations(); |
37 | 40 | |
41 | +/** |
|
42 | + * @param string $domain |
|
43 | + * @param string $mofile |
|
44 | + */ |
|
38 | 45 | function load_textdomain($domain, $mofile) { |
39 | 46 | global $translations; |
40 | 47 | $translations[$domain] = &load_translations($mofile); |
41 | 48 | } |
42 | 49 | |
50 | +/** |
|
51 | + * @param string $domain |
|
52 | + */ |
|
43 | 53 | function &get_translations($domain) { |
44 | 54 | global $translations, $empty_translations; |
45 | 55 | return isset($translations[$domain])? $translations[$domain] : $empty_translations; |
@@ -104,11 +104,18 @@ |
||
104 | 104 | |
105 | 105 | if ( !class_exists( 'POMO_FileReader' ) ): |
106 | 106 | class POMO_FileReader extends POMO_Reader { |
107 | + |
|
108 | + /** |
|
109 | + * @param string $filename |
|
110 | + */ |
|
107 | 111 | function POMO_FileReader($filename) { |
108 | 112 | parent::POMO_Reader(); |
109 | 113 | $this->_f = fopen($filename, 'rb'); |
110 | 114 | } |
111 | 115 | |
116 | + /** |
|
117 | + * @param integer $bytes |
|
118 | + */ |
|
112 | 119 | function read($bytes) { |
113 | 120 | return fread($this->_f, $bytes); |
114 | 121 | } |
@@ -63,10 +63,16 @@ discard block |
||
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
66 | + /** |
|
67 | + * @param string $header |
|
68 | + */ |
|
66 | 69 | function get_header($header) { |
67 | 70 | return isset($this->headers[$header])? $this->headers[$header] : false; |
68 | 71 | } |
69 | 72 | |
73 | + /** |
|
74 | + * @param Translation_Entry $entry |
|
75 | + */ |
|
70 | 76 | function translate_entry(&$entry) { |
71 | 77 | $key = $entry->key(); |
72 | 78 | return isset($this->entries[$key])? $this->entries[$key] : false; |
@@ -162,6 +168,8 @@ discard block |
||
162 | 168 | /** |
163 | 169 | * Makes a function, which will return the right translation index, according to the |
164 | 170 | * plural forms header |
171 | + * @param integer $nplurals |
|
172 | + * @param string $expression |
|
165 | 173 | */ |
166 | 174 | function make_plural_form_function($nplurals, $expression) { |
167 | 175 | $expression = str_replace('n', '$n', $expression); |
@@ -216,6 +224,10 @@ discard block |
||
216 | 224 | return $headers; |
217 | 225 | } |
218 | 226 | |
227 | + /** |
|
228 | + * @param string $header |
|
229 | + * @param string $value |
|
230 | + */ |
|
219 | 231 | function set_header($header, $value) { |
220 | 232 | parent::set_header($header, $value); |
221 | 233 | if ('Plural-Forms' == $header) { |
@@ -47,6 +47,9 @@ |
||
47 | 47 | return $pot; |
48 | 48 | } |
49 | 49 | |
50 | + /** |
|
51 | + * @param string[] $headers |
|
52 | + */ |
|
50 | 53 | function append( $ext_filename, $pot_filename, $headers = null ) { |
51 | 54 | if ( $headers ) |
52 | 55 | $this->headers = (array) $headers; |