[wp-polyglots] New default theme missing strings

K Suominen ksuominen at gmail.com
Tue Feb 22 02:26:33 GMT 2005


On Mon, 21 Feb 2005 19:27:24 -0600, Ryan Boren <ryan at boren.nu> wrote:
> On Mon, 2005-02-21 at 20:14 -0500, K Suominen wrote:
> >Adding the gettext calls to the code would be impossible to automate.
> >Removing it should be relatively trivial -- this would be a start:
> >
> >#!/usr/pkg/bin/perl -w
> >
> >while (<>) {
> >    s/__\((.)(.*?)\1( *,[^)]*)?\)/${1}${2}${1}/g;
> >    s/_e\((.)(.*?)\1( *,[^)]*)?\)/echo ${1}${2}${1}/g;
> >    print;
> >}
> >
> >In any case, my point being, removing gettext calls can be automated,
> >and I'll volunteer for writing the Makefile to do so.
> >
> 
> Turn this:
> 
> <p><?php printf( __('You are currently browsing the %1$s weblog archives
> for the \'%2$s\' category.'), '<a href="' .
> get_settings('siteurl') .'">' . get_bloginfo('name') . '</a>',
> single_cat_title('', false) ) ?></p>
> 
> Into this:
> 
> <p>You are currently browsing the <a href="<?php echo
> get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog
> archives for the '<?php echo single_cat_title(); ?>' category.</p>

If you indent the original differently, it'll be much easier to
understand, even with the %N$s strings in it.  With some discipline in
coding the default template, the result should be much better than
impossible.

> Notice that the functions used change depending on whether you are
> returning values into sprintf or echoing them directly to the page.

That's just a consequence of bad design.  You have just pointed out
another reason why having different functions just to avoid writing
"echo" at the beginning of code is not a good approach.  Anyway, I
don't think this particular thread needs to be revisited...  :-)

Regards,
+ Kim


More information about the wp-polyglots mailing list