#15985 closed defect (bug) (invalid)
_c (deprecated) by _x
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.1 |
| Component: | I18N | Keywords: | |
| Focuses: | Cc: |
Description
_x is declaring _c as deprecated, however _x and _c are not doing the same thing
reminder :
function _c( $text, $domain = 'default' ) {
_deprecated_function( __FUNCTION__, '2.9', '_x()' );
return before_last_bar( translate( $text, $domain ) );
}
function _x( $single, $context, $domain = 'default' ) {
return translate_with_gettext_context( $single, $context, $domain );
}
_x should clean up the string calling : before_last_bar()
after analysing the code, i really do not understand how the $context variable is handled as it is not present in the po/mo files
thank you for your explanations
Change History (6)
#1
@
15 years ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
#2
@
15 years ago
If you use makepot. Do you have any documentation on this (http://www.google.fr/search?q=makepot). It seems to be a pattern of some of your tickets
#4
in reply to:
↑ 3
@
15 years ago
Replying to nacin:
http://codex.wordpress.org/I18n_for_WordPress_Developers#Generating_a_POT_file
unfortunately my plugin has some text in xml files so i am afraid this is not supported by makepot.php
Note: See
TracTickets for help on using
tickets.
The old way of adding context to strings was to use a bar. For example,
_c('Post|noun'). The translators would keep the bar in and _c() would strip off everything after the last bar.We now use gettext context, thus it is a separate argument. It's not a drop-in replacement, as what would go after a bar instead needs to be its own argument.
If you use makepot, the context will carry into the various files.
Tickets are not the correct place to ask these questions. It seems to be a pattern of some of your tickets. That's okay, but you'd be better off trying a mailing list or IRC.