Code Duplication    Length = 16-17 lines in 2 locations

src/wp-includes/l10n.php 2 locations

@@ 361-376 (lines=16) @@
358
 *                       Default 'default'.
359
 * @return string The translated singular or plural form.
360
 */
361
function _n( $single, $plural, $number, $domain = 'default' ) {
362
	$translations = get_translations_for_domain( $domain );
363
	$translation  = $translations->translate_plural( $single, $plural, $number );
364
365
	/**
366
	 * Filters the singular or plural form of a string.
367
	 *
368
	 * @since 2.2.0
369
	 *
370
	 * @param string $translation Translated text.
371
	 * @param string $single      The text to be used if the number is singular.
372
	 * @param string $plural      The text to be used if the number is plural.
373
	 * @param string $number      The number to compare against to use either the singular or plural form.
374
	 * @param string $domain      Text domain. Unique identifier for retrieving translated strings.
375
	 */
376
	return apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain );
377
}
378
379
/**
@@ 402-418 (lines=17) @@
399
 *                        Default 'default'.
400
 * @return string The translated singular or plural form.
401
 */
402
function _nx($single, $plural, $number, $context, $domain = 'default') {
403
	$translations = get_translations_for_domain( $domain );
404
	$translation  = $translations->translate_plural( $single, $plural, $number, $context );
405
406
	/**
407
	 * Filters the singular or plural form of a string with gettext context.
408
	 *
409
	 * @since 2.8.0
410
	 *
411
	 * @param string $translation Translated text.
412
	 * @param string $single      The text to be used if the number is singular.
413
	 * @param string $plural      The text to be used if the number is plural.
414
	 * @param string $number      The number to compare against to use either the singular or plural form.
415
	 * @param string $context     Context information for the translators.
416
	 * @param string $domain      Text domain. Unique identifier for retrieving translated strings.
417
	 */
418
	return apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, $domain );
419
}
420
421
/**