Add _c() for disambiguatin translateable strings. Props nbachiyski. fixes #3687
git-svn-id: https://develop.svn.wordpress.org/trunk@5081 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
61a985f409
commit
8357362440
@ -37,6 +37,21 @@ function _e($text, $domain = 'default') {
|
||||
echo $text;
|
||||
}
|
||||
|
||||
function _c($text, $domain = 'default') {
|
||||
global $l10n;
|
||||
|
||||
if ( isset($l10n[$domain]) )
|
||||
$whole = apply_filters('gettext', $l10n[$domain]->translate($text), $text);
|
||||
else
|
||||
$whole = $text;
|
||||
|
||||
$trans = explode('|', $whole, 2);
|
||||
if ( isset( $trans[1] ) )
|
||||
return $trans[1];
|
||||
else
|
||||
return $trans[0];
|
||||
}
|
||||
|
||||
// Return the plural form.
|
||||
function __ngettext($single, $plural, $number, $domain = 'default') {
|
||||
global $l10n;
|
||||
|
Loading…
x
Reference in New Issue
Block a user