• Hello,

    It is a great plugin indeed, thanks guys!

    I have very confused and I really need rescue here. I want to add a new Arabic Blog.

    I have added a new site from network admin and chose Arabic under Multilingual Press tab in blog / site settings. Then, I connected it to teh English version.

    However, whenever I browse ar.sunjoytravel.com, I see that it still loads the style.css and not the rtl.css , and in the body tag it has lang attribute set to en_us.

    What am I missing in the installation? I have added the arabic.mo and .po files to wp-content/languages, and I am still getting no where.

    I am confused whether to set WPLANG global variable or what.

    Thanks in advance.

    http://ww.wp.xz.cn/extend/plugins/multilingual-press/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter m.qamaruddin

    (@mqamaruddin)

    I add a question here, because I noted that multipress did not change teh WP_LANG constant on any of the blogs, even though I set the language correctly in the “network admin”.

    Any help is highly appreciated.

    Thread Starter m.qamaruddin

    (@mqamaruddin)

    I have tried get_locale, and I am still only getting en_US always

    echo ‘local:>>’;
    var_dump(get_locale());
    exit;

    Thread Starter m.qamaruddin

    (@mqamaruddin)

    I have done this, but still not helping :

    if (!function_exists(‘mq_load_theme_translation’)) {

    function mq_load_theme_translation() {

    // Retrieve the directory for the localization files
    $lang_dir = WP_LANG_DIR . ‘/’ . get_locale() . ‘/sunjoytravel’;

    // Set the theme’s text domain using the unique identifier from above
    load_theme_textdomain(‘sunjoytravel’, $lang_dir);
    }

    // end custom_theme_setup
    }
    add_action(‘after_setup_theme’, ‘mq_load_theme_translation’);

    Thread Starter m.qamaruddin

    (@mqamaruddin)

    I found this snippet in source code :

    if ( ” != $data[ ‘inpsyde_multilingual_lang’ ] || ” != $data[ ‘inpsyde_multilingual’ ] ) {

    if ( ! is_array( $siteoption ) )
    $siteoption = array( );

    $siteoption[ $current_blog_id ] = array(
    ‘text’ => esc_attr( $data[ ‘inpsyde_multilingual_text’ ] ),
    ‘lang’ => esc_attr( $data[ ‘inpsyde_multilingual_lang’ ] )
    );
    }
    update_site_option( ‘inpsyde_multilingual’, $siteoption );

    Will it help to use this value to get the current locale? blog language?

    Thread Starter m.qamaruddin

    (@mqamaruddin)

    Is this any close? $result = $wpdb->update( $wpdb->sitemeta, array( ‘meta_value’ => $value ), array( ‘site_id’ => $wpdb->siteid, ‘meta_key’ => $option ) );

    By the way, I want the most standard and clean way.

    Thread Starter m.qamaruddin

    (@mqamaruddin)

    I used this, and it worked to load the text domain, but it is still not solving the main problem which is that for example the plugin did not set the language automatically and loaded rtl.css in case of Arabic.

    $locale = get_site_option(‘inpsyde_multilingual’);
    var_dump($locale[get_current_blog_id()]);

    Thread Starter m.qamaruddin

    (@mqamaruddin)

    I have been going through the source code of the WordPress :

    You see, even though I enforced the blog locale as mentioned above, it gets overriden here :

    function load_theme_textdomain( $domain, $path = false ) {
    	$locale = apply_filters( 'theme_locale', get_locale(), $domain );
    
    	if ( ! $path )
    		$path = get_template_directory();
    
    	// Load the textdomain from the Theme provided location, or theme directory first
    	$mofile = "{$path}/{$locale}.mo";
    	if ( $loaded = load_textdomain($domain, $mofile) )
    		return $loaded;
    
    	// Else, load textdomain from the Language directory
    	$mofile = WP_LANG_DIR . "/themes/{$domain}-{$locale}.mo";
    	return load_textdomain($domain, $mofile);
    }

    The locale is still not popularized with multipress locale or wplang or which is used to do the job?

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Exact New Language Installation Process!’ is closed to new replies.