Mark _c() as Deprecated people should use the new _x() instead. Fixes #11225.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d2f6a94dc3
commit
6ba5006153
|
@ -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