Ticket #35961: 35961.2.patch
File 35961.2.patch, 2.0 KB (added by , 9 years ago) |
---|
-
src/wp-includes/l10n.php
389 389 } 390 390 391 391 /** 392 * Registers plural strings in POT file, but do n't translate them.392 * Registers plural strings in POT file, but does not translate them. 393 393 * 394 394 * Used when you want to keep structures with translatable plural 395 395 * strings and use them later when the number is known. … … 426 426 } 427 427 428 428 /** 429 * Register plural strings with gettext context in the POT file, but don't translate them.429 * Registers plural strings with gettext context in POT file, but does not translate them. 430 430 * 431 431 * Used when you want to keep structures with translatable plural 432 432 * strings and use them later when the number is known. -
tests/phpunit/tests/l10n.php
150 150 $this->assertNotEmpty( $array['X-Generator'] ); 151 151 } 152 152 153 /** 154 * @ticket 35961 155 */ 156 function test_n_noop() { 157 $array = array( 0 => '%s post', 158 1 => '%s posts', 159 'singular' => '%s post', 160 'plural' => '%s posts', 161 'context' => null, 162 'domain' => 'text-domain' 163 ); 164 $this->assertEquals( $array, _n_noop( '%s post', '%s posts', 'text-domain' ) ); 165 } 166 167 /** 168 * @ticket 35961 169 */ 170 function test_nx_noop() { 171 $array = array( 0 => '%s post', 172 1 => '%s posts', 173 2 => 'context', 174 'singular' => '%s post', 175 'plural' => '%s posts', 176 'context' => 'context', 177 'domain' => 'text-domain' 178 ); 179 $this->assertEquals( $array, _nx_noop( '%s post', '%s posts', 'context', 'text-domain' ) ); 180 } 181 153 182 }