Mark _c() as Deprecated people should use the new _x() instead. Fixes #11225.
git-svn-id: https://develop.svn.wordpress.org/trunk@12257 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b1d71a4fcb
commit
43b9064424
@ -1786,4 +1786,28 @@ function make_url_footnote( $content ) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve translated string with vertical bar context
|
||||
*
|
||||
* Quite a few times, there will be collisions with similar translatable text
|
||||
* found in more than two places but with different translated context.
|
||||
*
|
||||
* In order to use the separate contexts, the _c() function is used and the
|
||||
* translatable string uses a pipe ('|') which has the context the string is in.
|
||||
*
|
||||
* When the translated string is returned, it is everything before the pipe, not
|
||||
* including the pipe character. If there is no pipe in the translated text then
|
||||
* everything is returned.
|
||||
*
|
||||
* @since 2.2.0
|
||||
* @deprecated 2.9.0
|
||||
*
|
||||
* @param string $text Text to translate
|
||||
* @param string $domain Optional. Domain to retrieve the translated text
|
||||
* @return string Translated context string without pipe
|
||||
*/
|
||||
function _c( $text, $domain = 'default' ) {
|
||||
_deprecated_function(__FUNCTION__, '2.9', '_x' );
|
||||
return translate_with_context( $text, $domain );
|
||||
}
|
||||
?>
|
@ -176,27 +176,21 @@ function esc_html_e( $text, $domain = 'default' ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve translated string with vertical bar context
|
||||
* Retrieve translated string with gettext context
|
||||
*
|
||||
* Quite a few times, there will be collisions with similar translatable text
|
||||
* found in more than two places but with different translated context.
|
||||
*
|
||||
* In order to use the separate contexts, the _c() function is used and the
|
||||
* translatable string uses a pipe ('|') which has the context the string is in.
|
||||
* By including the context in the pot file translators can translate the two
|
||||
* string differently
|
||||
*
|
||||
* When the translated string is returned, it is everything before the pipe, not
|
||||
* including the pipe character. If there is no pipe in the translated text then
|
||||
* everything is returned.
|
||||
*
|
||||
* @since 2.2.0
|
||||
* @since 2.8
|
||||
*
|
||||
* @param string $text Text to translate
|
||||
* @param string $context Context information for the translators
|
||||
* @param string $domain Optional. Domain to retrieve the translated text
|
||||
* @return string Translated context string without pipe
|
||||
*/
|
||||
function _c( $text, $domain = 'default' ) {
|
||||
return translate_with_context( $text, $domain );
|
||||
}
|
||||
|
||||
function _x( $single, $context, $domain = 'default' ) {
|
||||
return translate_with_gettext_context( $single, $context, $domain );
|
||||
|
Loading…
Reference in New Issue
Block a user