Ticket #49518: 49518.diff
File 49518.diff, 4.2 KB (added by , 3 years ago) |
---|
-
src/wp-includes/l10n.php
165 165 * *Note:* Don't use translate() directly, use __() or related functions. 166 166 * 167 167 * @since 2.2.0 168 * @since 5.5.0 Introduced gettext-{$domain} filter. 168 169 * 169 170 * @param string $text Text to translate. 170 171 * @param string $domain Optional. Text domain. Unique identifier for retrieving translated strings. … … 176 177 $translation = $translations->translate( $text ); 177 178 178 179 /** 180 * Filters text with its translation for a domain. 181 * 182 * @since 5.5.0 183 * 184 * @param string $translation Translated text. 185 * @param string $text Text to translate. 186 */ 187 $translation = apply_filters( 'gettext-' . $domain, $translation, $text ); 188 189 /** 179 190 * Filters text with its translation. 180 191 * 181 192 * @since 2.0.11 … … 215 226 * *Note:* Don't use translate_with_gettext_context() directly, use _x() or related functions. 216 227 * 217 228 * @since 2.8.0 229 * @since 5.5.0 Introduced gettext_with_context-{$domain} filter. 218 230 * 219 231 * @param string $text Text to translate. 220 232 * @param string $context Context information for the translators. … … 225 237 function translate_with_gettext_context( $text, $context, $domain = 'default' ) { 226 238 $translations = get_translations_for_domain( $domain ); 227 239 $translation = $translations->translate( $text, $context ); 240 228 241 /** 242 * Filters text with its translation based on context information for a domain. 243 * 244 * @since 5.5.0 245 * 246 * @param string $translation Translated text. 247 * @param string $text Text to translate. 248 * @param string $context Context information for the translators. 249 */ 250 $translation = apply_filters( 'gettext_with_context-' . $domain, $translation, $text, $context ); 251 252 /** 229 253 * Filters text with its translation based on context information. 230 254 * 231 255 * @since 2.8.0 … … 419 443 * printf( _n( '%s person', '%s people', $count, 'text-domain' ), number_format_i18n( $count ) ); 420 444 * 421 445 * @since 2.8.0 446 * @since 5.5.0 Introduced ngettext-{$domain} filter. 422 447 * 423 448 * @param string $single The text to be used if the number is singular. 424 449 * @param string $plural The text to be used if the number is plural. … … 432 457 $translation = $translations->translate_plural( $single, $plural, $number ); 433 458 434 459 /** 460 * Filters the singular or plural form of a string for a domain. 461 * 462 * @since 5.5.0 463 * 464 * @param string $translation Translated text. 465 * @param string $single The text to be used if the number is singular. 466 * @param string $plural The text to be used if the number is plural. 467 * @param string $number The number to compare against to use either the singular or plural form. 468 */ 469 $translation = apply_filters( 'ngettext-' . $domain, $translation, $single, $plural, $number ); 470 471 /** 435 472 * Filters the singular or plural form of a string. 436 473 * 437 474 * @since 2.2.0 … … 459 496 * printf( _nx( '%s group', '%s groups', $animals, 'group of animals', 'text-domain' ), number_format_i18n( $animals ) ); 460 497 * 461 498 * @since 2.8.0 499 * @since 5.5.0 Introduced ngettext_with_context-{$domain} filter. 462 500 * 463 501 * @param string $single The text to be used if the number is singular. 464 502 * @param string $plural The text to be used if the number is plural. … … 473 511 $translation = $translations->translate_plural( $single, $plural, $number, $context ); 474 512 475 513 /** 514 * Filters the singular or plural form of a string with gettext context for a domain. 515 * 516 * @since 5.5.0 517 * 518 * @param string $translation Translated text. 519 * @param string $single The text to be used if the number is singular. 520 * @param string $plural The text to be used if the number is plural. 521 * @param string $number The number to compare against to use either the singular or plural form. 522 * @param string $context Context information for the translators. 523 */ 524 $translation = apply_filters( 'ngettext_with_context-' . $domain, $translation, $single, $plural, $number, $context ); 525 526 /** 476 527 * Filters the singular or plural form of a string with gettext context. 477 528 * 478 529 * @since 2.8.0