WordPress.org

Make WordPress Core

Changeset 5081


Ignore:
Timestamp:
03/22/2007 03:34:23 AM (15 years ago)
Author:
ryan
Message:

Add _c() for disambiguatin translateable strings. Props nbachiyski. fixes #3687

File:
1 edited

Legend:

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

    r4764 r5081  
    3636    else
    3737        echo $text;
     38}
     39
     40function _c($text, $domain = 'default') {
     41    global $l10n;
     42
     43    if ( isset($l10n[$domain]) )
     44        $whole = apply_filters('gettext', $l10n[$domain]->translate($text), $text);
     45    else
     46        $whole = $text;
     47
     48    $trans = explode('|', $whole, 2);
     49    if ( isset( $trans[1] ) )
     50        return $trans[1];
     51    else
     52        return $trans[0];   
    3853}
    3954
Note: See TracChangeset for help on using the changeset viewer.