[wp-trac] [WordPress Trac] #12905: the_title_attribute() is hard to internationalize
WordPress Trac
wp-trac at lists.automattic.com
Wed Apr 7 19:47:18 UTC 2010
#12905: the_title_attribute() is hard to internationalize
--------------------------+-------------------------------------------------
Reporter: mdawaffe | Owner: nbachiyski
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: i18n | Version: 3.0
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
To internationalize the output of the_title_attribute, you have to go
through some hoops.
{{{
printf( esc_attr__( 'Permanent link to %s' ), the_title_attribute(
'echo=0' ) );
}}}
Adding a 'formatted' argument to the args array would clean it up a
little.
{{{
the_title_attribute( array( 'formatted' => __( 'Permanent link to %s' ) )
);
}}}
Even better would be if we could auto detect what the first parameter was.
{{{
the_title_attribute( __( 'Permanent link to %s' ) );
}}}
It'd require the function to try and detect if it's first argument were a
sprintf format. Maybe: look for %, if found, does sprintf return a
string, if so, go for it.
Attached is one way to implement.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12905>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list