Make WordPress Core

Changeset 12257


Ignore:
Timestamp:
11/22/2009 12:07:41 PM (15 years ago)
Author:
westi
Message:

Mark _c() as Deprecated people should use the new _x() instead. Fixes #11225.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r12203 r12257  
    17871787}
    17881788
     1789/**
     1790 * Retrieve translated string with vertical bar context
     1791 *
     1792 * Quite a few times, there will be collisions with similar translatable text
     1793 * found in more than two places but with different translated context.
     1794 *
     1795 * In order to use the separate contexts, the _c() function is used and the
     1796 * translatable string uses a pipe ('|') which has the context the string is in.
     1797 *
     1798 * When the translated string is returned, it is everything before the pipe, not
     1799 * including the pipe character. If there is no pipe in the translated text then
     1800 * everything is returned.
     1801 *
     1802 * @since 2.2.0
     1803 * @deprecated 2.9.0
     1804 *
     1805 * @param string $text Text to translate
     1806 * @param string $domain Optional. Domain to retrieve the translated text
     1807 * @return string Translated context string without pipe
     1808 */
     1809function _c( $text, $domain = 'default' ) {
     1810    _deprecated_function(__FUNCTION__, '2.9', '_x' );
     1811    return translate_with_context( $text, $domain );
     1812}
    17891813?>
  • trunk/wp-includes/l10n.php

    r12251 r12257  
    177177
    178178/**
    179  * Retrieve translated string with vertical bar context
     179 * Retrieve translated string with gettext context
    180180 *
    181181 * Quite a few times, there will be collisions with similar translatable text
    182182 * found in more than two places but with different translated context.
    183183 *
    184  * In order to use the separate contexts, the _c() function is used and the
    185  * translatable string uses a pipe ('|') which has the context the string is in.
    186  *
    187  * When the translated string is returned, it is everything before the pipe, not
    188  * including the pipe character. If there is no pipe in the translated text then
    189  * everything is returned.
    190  *
    191  * @since 2.2.0
    192  *
    193  * @param string $text Text to translate
     184 * By including the context in the pot file translators can translate the two
     185 * string differently
     186 *
     187 * @since 2.8
     188 *
     189 * @param string $text Text to translate
     190 * @param string $context Context information for the translators
    194191 * @param string $domain Optional. Domain to retrieve the translated text
    195192 * @return string Translated context string without pipe
    196193 */
    197 function _c( $text, $domain = 'default' ) {
    198     return translate_with_context( $text, $domain );
    199 }
    200194
    201195function _x( $single, $context, $domain = 'default' ) {
Note: See TracChangeset for help on using the changeset viewer.