Make WordPress Core


Ignore:
Timestamp:
03/10/2009 11:02:29 PM (16 years ago)
Author:
ryan
Message:

gettext contexts. Props nbachiyski. see #9112

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/l10n.php

    r10584 r10767  
    177177    $translations = &get_translations_for_domain( $domain );
    178178    $translation = $translations->translate_plural( $single, $plural, $number );
    179     return apply_filters( 'ngettext', $translation, $single, $plural, $number );
     179    return apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain );
    180180}
    181181
     
    192192    $translations = &get_translations_for_domain( $domain );
    193193    $translation = $translations->translate_plural( $single, $plural, $number, $context );
    194     return apply_filters( 'ngettext_with_context ', $translation, $single, $plural, $number, $context );
     194    return apply_filters( 'ngettext_with_context ', $translation, $single, $plural, $number, $context, $domain );
    195195}
    196196
     
    341341}
    342342
     343/**
     344 * Translates role name. Since the role names are in the database and
     345 * not in the source there are dummy gettext calls to get them into the POT
     346 * file and this function properly translates them back.
     347 *
     348 * The before_last_bar() call is needed, because older installs keep the roles
     349 * using the old context format: 'Role name|User role' and just skipping the
     350 * content after the last bar is easier than fixing them in the DB. New installs
     351 * won't suffer from that problem.
     352 */
     353function translate_user_role( $name ) {
     354    return before_last_bar( translate_with_gettext_context( $name, 'User role' ) );
     355}
    343356?>
Note: See TracChangeset for help on using the changeset viewer.