[wp-trac] Re: [WordPress Trac] #4916: comment_type function doesn't
return the comment type string
WordPress Trac
wp-trac at lists.automattic.com
Fri Sep 7 04:58:19 GMT 2007
#4916: comment_type function doesn't return the comment type string
---------------------------------------+------------------------------------
Reporter: hudatoriq | Owner: hudatoriq
Type: defect | Status: reopened
Priority: normal | Milestone: 2.3
Component: General | Version: 2.3
Severity: normal | Resolution:
Keywords: comment reporter-feedback |
---------------------------------------+------------------------------------
Comment (by hudatoriq):
I was internationalizing a wordpress template when I met this problem.
Usage example on WP template:
For a unilanguage theme, we can simply write it like this:
{{{
<?php comment_type('Comment', 'Trackback', 'Pingback'); ?> by <?php
comment_author_link(); ?> on <?php comment_date(); ?>
}}}
The problem is, I can't get it internationalized, 'cause in this case, I
need the comment_type to returning the output instead of echoing it.
If my proposal is approved, this is how the code above will look like
after it gets internationalized
{{{
<?php printf(__('%1$s by %2$s on %3$s', 'themedomain'),
comment_type(__('Comment', 'themedomain'), __('Trackback', 'themedomain'),
__('Pingback', 'themedomain'), false), get_comment_author_link(),
get_comment_date()); ?>
}}}
Adding a filter is a good idea too. But isn't a good solution for a
template.
The purpose of the file comment-template.php is to help people develop
their WP template, isn't it? The combination of both solution (filter &
new parameter) maybe?
--
Ticket URL: <http://trac.wordpress.org/ticket/4916#comment:5>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list