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

git-svn-id: http://svn.automattic.com/wordpress/trunk@5081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-03-22 03:34:23 +00:00
parent 9f9d9a8d9e
commit 43e6d1b011
1 changed files with 15 additions and 0 deletions

View File

@ -37,6 +37,21 @@ function _e($text, $domain = 'default') {
echo $text; 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. // Return the plural form.
function __ngettext($single, $plural, $number, $domain = 'default') { function __ngettext($single, $plural, $number, $domain = 'default') {
global $l10n; global $l10n;