Changeset 48131 for trunk/src/wp-includes/l10n.php
- Timestamp:
- 06/23/2020 04:41:02 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n.php
r48109 r48131 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. … … 185 186 * @param string $domain Text domain. Unique identifier for retrieving translated strings. 186 187 */ 187 return apply_filters( 'gettext', $translation, $text, $domain ); 188 $translation = apply_filters( 'gettext', $translation, $text, $domain ); 189 190 /** 191 * Filters text with its translation for a domain. 192 * 193 * @since 5.5.0 194 * 195 * @param string $translation Translated text. 196 * @param string $text Text to translate. 197 */ 198 return apply_filters( 'gettext-' . $domain, $translation, $text ); 188 199 } 189 200 … … 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. … … 226 238 $translations = get_translations_for_domain( $domain ); 227 239 $translation = $translations->translate( $text, $context ); 240 228 241 /** 229 242 * Filters text with its translation based on context information. … … 236 249 * @param string $domain Text domain. Unique identifier for retrieving translated strings. 237 250 */ 238 return apply_filters( 'gettext_with_context', $translation, $text, $context, $domain ); 251 $translation = apply_filters( 'gettext_with_context', $translation, $text, $context, $domain ); 252 253 /** 254 * Filters text with its translation based on context information for a domain. 255 * 256 * @since 5.5.0 257 * 258 * @param string $translation Translated text. 259 * @param string $text Text to translate. 260 * @param string $context Context information for the translators. 261 */ 262 return apply_filters( 'gettext_with_context-' . $domain, $translation, $text, $context ); 239 263 } 240 264 … … 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. … … 443 468 * @param string $domain Text domain. Unique identifier for retrieving translated strings. 444 469 */ 445 return apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain ); 470 $translation = apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain ); 471 472 /** 473 * Filters the singular or plural form of a string for a domain. 474 * 475 * @since 5.5.0 476 * 477 * @param string $translation Translated text. 478 * @param string $single The text to be used if the number is singular. 479 * @param string $plural The text to be used if the number is plural. 480 * @param string $number The number to compare against to use either the singular or plural form. 481 */ 482 return apply_filters( 'ngettext-' . $domain, $translation, $single, $plural, $number ); 446 483 } 447 484 … … 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. … … 485 523 * @param string $domain Text domain. Unique identifier for retrieving translated strings. 486 524 */ 487 return apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain ); 525 $translation = apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain ); 526 527 /** 528 * Filters the singular or plural form of a string with gettext context for a domain. 529 * 530 * @since 5.5.0 531 * 532 * @param string $translation Translated text. 533 * @param string $single The text to be used if the number is singular. 534 * @param string $plural The text to be used if the number is plural. 535 * @param string $number The number to compare against to use either the singular or plural form. 536 * @param string $context Context information for the translators. 537 */ 538 return apply_filters( 'ngettext_with_context-' . $domain, $translation, $single, $plural, $number, $context ); 488 539 } 489 540
Note: See TracChangeset
for help on using the changeset viewer.