Support » Plugin: Codestyling Localization » False alert for load_textdomain

  • Resolved Stevesan



    I’m getting the alert message that some plugins are using load_textdomain instead of the load_plugin_textdomain. So I’m contacting the plugin authors one by one. And step by step I’m having it fixed.

    One of them, however, claims it to be a false alert. It’s the Contact Form 7 plugin here at the repository. Could you clarify to me what’s up here?

    Thanks for a super plugin.


Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codestyling


    This is not a false alert.
    Here the code snippet from actual “Contact Form 7” code version 3.4.2:

    function wpcf7_get_contact_form_default_pack( $args = '' ) {
    	global $l10n;
    	$defaults = array( 'locale' => null, 'title' => '' );
    	$args = wp_parse_args( $args, $defaults );
    	$locale = $args['locale'];
    	$title = $args['title'];
    	if ( $locale && $locale != get_locale() ) {
    		$mo_orig = $l10n['wpcf7'];
    		unset( $l10n['wpcf7'] );
    		if ( 'en_US' != $locale ) {
    			$mofile = wpcf7_plugin_path( 'languages/wpcf7-' . $locale . '.mo' );
    			if ( ! load_textdomain( 'wpcf7', $mofile ) ) {
    				$l10n['wpcf7'] = $mo_orig;
    				unset( $mo_orig );

    As can be seen, it uses indeed:
    load_textdomain( 'wpcf7', $mofile )

    I sort of suspected that. I’ll send this info to the author of the Contact code plugin. Thanks!


    PS. I’m no codeguru, but is this an esy fix, I mean simply repacing the call for load_textdomain with load_plugin_textdomain ?

    I got a message back from the developer. I showed him your message above, this is what he says:

    “The load_textdomain is not used instead of load_plugin_textdomain. Also, use of load_textdomain can’t break behavior of WordPress. It merely makes Codestyling Localization impossible to interfere in other plugins process. As you may know from the code above, the load_textdomain is used for loading a translation for a specific language (not current locale), there is no need for Codestyling Localization to interfere in.”

    I’m no code guru, and I don’t get any of this. I’m not sure if you talk about the same thing or if there’s a misundrestanding involved or something.

    Thanks for helping!


    I’m having the same issue with “Author is using load_textdomain instead of load_plugin_textdomain function” while using a Barberry theme and Woocommerce. It makes the plugin Codestyling Localization unable to do any actual localization meaning no translation. There seems to be no solution from either Codestyling or theme developers.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘False alert for load_textdomain’ is closed to new replies.