[wp-polyglots] New default theme missing strings

Ryan Boren ryan at boren.nu
Tue Feb 22 01:27:24 GMT 2005


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>  

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

Ryan




More information about the wp-polyglots mailing list