translation problem

I don't know if load_textdomain in domain-mapping.php work or not but i had to change the function to make it working :

function load_textdomain() {
load_muplugin_textdomain('domainmap', dirname(plugin_basename(__FILE__)).'/languages');
}

and then i can put wp-content/mu-plugins/languages/domainmap-fr_FR.mo

and it works

  • tribagora
    • Flash Drive

    My new function :
    function load_textdomain() {

    load_muplugin_textdomain('domainmap', dirname(plugin_basename(__FILE__)).'/languages');

    /* $locale = apply_filters( 'domainmap_locale', get_locale() );

    $mofile = domainmap_dir( "languages/domainmap-$locale.mo" );

    if ( file_exists( $mofile ) )

    load_textdomain( 'domainmap', $mofile );*/

    }

    but i think i have found the bug (sorry for ^M but i don't use windows) :
    In the function set_domainmap_dir, there is a mistake, you must replace
    WPMU_PLUGIN_URL by WPMU_PLUGIN_DIR and then it works :

    function set_domainmap_dir($base) {^M
    ^M
    global $domainmap_dir;^M
    if(defined('WPMU_PLUGIN_DIR') && file_exists(WPMU_PLUGIN_DIR . '/' . basename($base))) {^M
    $domainmap_dir = trailingslashit(WPMU_PLUGIN_DIR);^M
    /* $domainmap_dir = trailingslashit(WPMU_PLUGIN_URL);^M*/
    } elseif(defined('WP_PLUGIN_DIR') && file_exists(WP_PLUGIN_DIR . '/domain-mapping/' . basename($base))) {^M
    $domainmap_dir = trailingslashit(WP_PLUGIN_DIR . '/domain-mapping');^M
    } else {^M
    $domainmap_dir = trailingslashit(WP_PLUGIN_DIR . '/domain-mapping');^M
    }^M
    ^M
    ^M
    }^M

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.