From 10a6d0e916cded1718526c8b46f4dd6c73006303 Mon Sep 17 00:00:00 2001 From: westi Date: Sat, 19 Dec 2009 10:51:29 +0000 Subject: [PATCH] Deprecate _nc() as _nx() is a much better was of specifying contexts. Fixes #11404 props nacin. git-svn-id: http://svn.automattic.com/wordpress/trunk@12459 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/dashboard.php | 2 +- wp-includes/deprecated.php | 21 ++++++++++++++++++++- wp-includes/l10n.php | 10 ++++------ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 6137a93c1..2ce185e1a 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -260,7 +260,7 @@ function wp_dashboard_right_now() { // Approved Comments $num = '' . number_format_i18n($num_comm->approved) . ''; - $text = _nc( 'Approved|Right Now', 'Approved', $num_comm->approved ); + $text = _nx( 'Approved', 'Approved', $num_comm->approved, 'Right Now' ); if ( current_user_can( 'moderate_comments' ) ) { $num = "$num"; $text = "$text"; diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php index 0b546ebff..f7625d8c0 100644 --- a/wp-includes/deprecated.php +++ b/wp-includes/deprecated.php @@ -1801,6 +1801,8 @@ function make_url_footnote( $content ) { * * @since 2.2.0 * @deprecated 2.9.0 + * @deprecated Use _x() + * @see _x() * * @param string $text Text to translate * @param string $domain Optional. Domain to retrieve the translated text @@ -1810,4 +1812,21 @@ function _c( $text, $domain = 'default' ) { _deprecated_function(__FUNCTION__, '2.9', '_x' ); return translate_with_context( $text, $domain ); } -?> \ No newline at end of file + +/** + * A version of _n(), which supports contexts. + * Strips everything from the translation after the last bar. + * + * @since 2.7.0 + * @deprecated 3.0.0 + * @deprecated Use _nx() + * @see _nx() + * @see _n() For parameters. + * @see _c() For parameters. _c() is deprecated. + * + */ +function _nc( $single, $plural, $number, $domain = 'default' ) { + _deprecated_function(__FUNCTION__, '2.9', '_nx' ); + return before_last_bar( _n( $single, $plural, $number, $domain ) ); +} +?> diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index e138c8016..88b13efbd 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -239,14 +239,12 @@ function _n( $single, $plural, $number, $domain = 'default' ) { } /** - * @see _n() A version of _n(), which supports contexts -- - * strips everything from the translation after the last bar + * A hybrid of _n() and _x(). It supports contexts and plurals. + * + * @see _n() + * @see _x() * */ -function _nc( $single, $plural, $number, $domain = 'default' ) { - return before_last_bar( _n( $single, $plural, $number, $domain ) ); -} - function _nx($single, $plural, $number, $context, $domain = 'default') { $translations = &get_translations_for_domain( $domain ); $translation = $translations->translate_plural( $single, $plural, $number, $context );