WordPress.org

Make WordPress Core

Changeset 12459


Ignore:
Timestamp:
12/19/2009 10:51:29 AM (10 years ago)
Author:
westi
Message:

Deprecate _nc() as _nx() is a much better was of specifying contexts. Fixes #11404 props nacin.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r12401 r12459  
    261261    // Approved Comments
    262262    $num = '<span class="approved-count">' . number_format_i18n($num_comm->approved) . '</span>';
    263     $text = _nc( 'Approved|Right Now', 'Approved', $num_comm->approved );
     263    $text = _nx( 'Approved', 'Approved', $num_comm->approved, 'Right Now' );
    264264    if ( current_user_can( 'moderate_comments' ) ) {
    265265        $num = "<a href='edit-comments.php?comment_status=approved'>$num</a>";
  • trunk/wp-includes/deprecated.php

    r12257 r12459  
    18021802 * @since 2.2.0
    18031803 * @deprecated 2.9.0
     1804 * @deprecated Use _x()
     1805 * @see _x()
    18041806 *
    18051807 * @param string $text Text to translate
     
    18111813    return translate_with_context( $text, $domain );
    18121814}
     1815
     1816/**
     1817 * A version of _n(), which supports contexts.
     1818 * Strips everything from the translation after the last bar.
     1819 *
     1820 * @since 2.7.0
     1821 * @deprecated 3.0.0
     1822 * @deprecated Use _nx()
     1823 * @see _nx()
     1824 * @see _n() For parameters.
     1825 * @see _c() For parameters. _c() is deprecated.
     1826 *
     1827 */
     1828function _nc( $single, $plural, $number, $domain = 'default' ) {
     1829    _deprecated_function(__FUNCTION__, '2.9', '_nx' );
     1830    return before_last_bar( _n( $single, $plural, $number, $domain ) );
     1831}
    18131832?>
  • trunk/wp-includes/l10n.php

    r12257 r12459  
    240240
    241241/**
    242  * @see _n() A version of _n(), which supports contexts --
    243  * strips everything from the translation after the last bar
    244  *
    245  */
    246 function _nc( $single, $plural, $number, $domain = 'default' ) {
    247     return before_last_bar( _n( $single, $plural, $number, $domain ) );
    248 }
    249 
     242 * A hybrid of _n() and _x(). It supports contexts and plurals.
     243 *
     244 * @see _n()
     245 * @see _x()
     246 *
     247 */
    250248function _nx($single, $plural, $number, $context, $domain = 'default') {
    251249    $translations = &get_translations_for_domain( $domain );
Note: See TracChangeset for help on using the changeset viewer.