[wp-hackers] Non-gettexted string detection tools?

J.D. Grimes jdg at codesymphony.co
Wed Sep 25 14:06:59 UTC 2013


Thank you all for the links!

I think I'm going to follow Nikola's idea. And I'll be sure to share the results back here when I'm done.

Thanks,

J.D.

On Sep 25, 2013, at 3:21 AM, Nikola Nikolov <nikolov.tmw at gmail.com> wrote:

> What I feel like you're aiming for is parsing php files and finding any
> un-translated strings in there.
> 
> The plugin that I regularly use in order to edit/create .po/.mo files -
> http://wordpress.org/plugins/codestyling-localization/ - does something
> similar, except for it only looks for translated strings. My recommendation
> would be to take a look at it's code(more specifically the
> "/includes/class.parser.php" file -
> http://plugins.svn.wordpress.org/codestyling-localization/trunk/includes/class.parser.php
> )
> and try to adjust it to ignore any strings that have already been
> translated and collect the ones that haven't.
> 
> I think that code is a good place to start and you can probably do that
> with just a simple file in the beginning and then move on to series of
> files in a plugin/theme.
> 
> Good luck with that and I'd like to know when you get it done :)
> 
> Nikola
> 
> 
> On Wed, Sep 25, 2013 at 3:32 AM, Andrew Nacin <wp at andrewnacin.com> wrote:
> 
>> On Tue, Sep 24, 2013 at 7:30 PM, Shea Bunge <info at bungeshea.com> wrote:
>> 
>>> You can try the Pig Latin <http://wordpress.org/plugins/piglatin/>
>> plugin
>>> that displays all translatable strings as Pig
>>> Latin<http://en.wikipedia.org/wiki/Pig_Latin>.
>>> This way, all untranslated strings stick out.
>>> 
>>> Others might laugh, but this is pretty standard practice.
>> 
>> Others prefer an encheferizer.
>> http://en.wikipedia.org/wiki/Swedish_Chef#Computer_translations
>> 
>> For something more jarring, try:
>> 
>> $empty_string = function() { return ''; };
>> foreach ( array( 'gettext', 'ngettext' ) as $filter ) {
>>    add_filter( $filter, $empty_string );
>>    add_filter( $filter . '_with_context', $empty_string );
>> }
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list