Changeset 53543
- Timestamp:
- 06/20/2022 10:55:52 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/category-template.php
r53392 r53543 824 824 * @type int|bool $filter Whether to enable filtering of the final output 825 825 * via {@see 'wp_generate_tag_cloud'}. Default 1. 826 * @type string$topic_count_text Nooped plural text from _n_noop() to supply to826 * @type array $topic_count_text Nooped plural text from _n_noop() to supply to 827 827 * tag counts. Default null. 828 828 * @type callable $topic_count_text_callback Callback used to generate nooped plural text for -
trunk/src/wp-includes/l10n.php
r53474 r53543 588 588 * Array of translation information for the strings. 589 589 * 590 * @type string $0 Singular form to be localized. No longer used.591 * @type string $1 Plural form to be localized. No longer used.592 * @type string $singular Singular form to be localized.593 * @type string $plural Plural form to be localized.594 * @type null $context Context information for the translators.595 * @type string $domain Text domain.590 * @type string $0 Singular form to be localized. No longer used. 591 * @type string $1 Plural form to be localized. No longer used. 592 * @type string $singular Singular form to be localized. 593 * @type string $plural Plural form to be localized. 594 * @type null $context Context information for the translators. 595 * @type string|null $domain Text domain. 596 596 * } 597 597 */ … … 655 655 656 656 /** 657 * Translates and ret rieves the singular or plural form of a string that's been registered657 * Translates and returns the singular or plural form of a string that's been registered 658 658 * with _n_noop() or _nx_noop(). 659 659 * … … 668 668 * @since 3.1.0 669 669 * 670 * @param array $nooped_plural Array with singular, plural, and context keys, usually the result of _n_noop() or _nx_noop(). 670 * @param array $nooped_plural { 671 * Array that is usually a return value from _n_noop() or _nx_noop(). 672 * 673 * @type string $singular Singular form to be localized. 674 * @type string $plural Plural form to be localized. 675 * @type string|null $context Context information for the translators. 676 * @type string|null $domain Text domain. 677 * } 671 678 * @param int $count Number of objects. 672 679 * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings. If $nooped_plural contains 673 680 * a text domain passed to _n_noop() or _nx_noop(), it will override this value. Default 'default'. 674 * @return string Either $sing leor $plural translated text.681 * @return string Either $singular or $plural translated text. 675 682 */ 676 683 function translate_nooped_plural( $nooped_plural, $count, $domain = 'default' ) { -
trunk/src/wp-includes/post.php
r53507 r53543 1255 1255 * @type bool|string $label A descriptive name for the post status marked 1256 1256 * for translation. Defaults to value of $post_status. 1257 * @type bool|array $label_count Descriptive text to use for nooped plurals. 1258 * Default array of $label, twice. 1257 * @type array|false $label_count Nooped plural text from _n_noop() to provide the singular 1258 * and plural forms of the label for counts. Default false 1259 * which means the `$label` argument will be used for both 1260 * the singular and plural forms of this label. 1259 1261 * @type bool $exclude_from_search Whether to exclude posts with this post status 1260 1262 * from search results. Default is value of $internal. -
trunk/tests/phpunit/tests/l10n.php
r52259 r53543 23 23 $nooped_plural = _n_noop( '%s post', '%s posts', $text_domain ); 24 24 25 $this->assert NotEmpty($nooped_plural['domain'] );25 $this->assertSame( 'text-domain', $nooped_plural['domain'] ); 26 26 $this->assertSame( '%s posts', translate_nooped_plural( $nooped_plural, 0, $text_domain ) ); 27 27 $this->assertSame( '%s post', translate_nooped_plural( $nooped_plural, 1, $text_domain ) ); … … 36 36 $nooped_plural = _nx_noop( '%s post', '%s posts', 'my-context', $text_domain ); 37 37 38 $this->assert NotEmpty($nooped_plural['domain'] );39 $this->assert NotEmpty($nooped_plural['context'] );38 $this->assertSame( 'text-domain', $nooped_plural['domain'] ); 39 $this->assertSame( 'my-context', $nooped_plural['context'] ); 40 40 $this->assertSame( '%s posts', translate_nooped_plural( $nooped_plural, 0, $text_domain ) ); 41 41 $this->assertSame( '%s post', translate_nooped_plural( $nooped_plural, 1, $text_domain ) );
Note: See TracChangeset
for help on using the changeset viewer.