3

My wordpress admin is in french. and my theme is in arabic. i have two files mo : arabic and french.

i used this :

add_filter( 'locale', 'change_locale' );
function change_locale(){ return 'pt_AR'; }
load_default_textdomain();
load_textdomain('responsive', get_template_directory().'/languages/pt_AR.mo');

i have my site web in araic only if i deleted the file french pt_FR.mo if this file exit, my site web is will be in french not in arabic

how can fixed it ?!

3
  • 1
    Is there a reason for using non-standard locales? Can you use 'ar' for Arabic and 'fr_FR' for French? If you can I'll show you how to do it. Aug 16 '15 at 17:01
  • jsute i rename the file arabic with ar.mo and the french and the french file with fr_FR ? and i change the code with this :add_filter( 'locale', 'change_locale' ); function change_locale(){ return 'ar'; } load_default_textdomain(); load_textdomain('responsive', get_template_directory().'/languages/ar.mo'); ?!
    – pikamo
    Aug 17 '15 at 17:31
  • i have creat the two file translation my theme with poedit in arabic and in french .... for used in futur if the client needed
    – pikamo
    Aug 17 '15 at 17:44
0

Yes, rename your pt_AR.mo to ar.mo and pt_FR to fr_FR.mo.

In step one install but not activate yet the plugin Admin in English. Edit the plugin's php script. Find line with en_US string and replace this string with fr_FR. Save and activate the plugin. Now your Dashboard will be in French. In step two remove first three lines of your code from theme's functions.php and replace fourth one withload_theme_textdomain('responsive', get_template_directory().'/languages');. In final step go toRéglages -> Général` and select Arabic as your site's language. Now you should have your front end in Arabic and back end in French.

0

i have instaled English WordPress Admin (Version 1.5.1 | Par khromov he is compatible with my Wordpress version) and i have changed english-wp-admin/english-wp-admin.php

//Switch locale if we are on an admin page 
 if(is_admin()) {
            return 'fr_FR';
        }
  //If using WPLANG, otherwise check DB
    if(defined('WPLANG')) {
        return (WPLANG === 'fr_FR' || trim(WPLANG) === '') ? true : false;
    }
    else
    {
        //If language not en_US and not empty in database
        if(function_exists('get_bloginfo') && (get_bloginfo('language') !== 'fr_FR' || trim(get_bloginfo('language')) !== '') ) {
            return false;
        }
        else {
            return true;
        }
    }

in my fonction theme i have this lines;

<?php
$t4pthemename = "HUMIX";
if ( get_stylesheet_directory() == get_template_directory() ) {
define('T4P_URL', get_template_directory() . '/library/functions/');
define('T4P_DIRECTORY', get_template_directory_uri() . '/library/functions/');
} else {
define('T4P_URL', get_template_directory() . '/library/functions/');
define('T4P_DIRECTORY', get_template_directory_uri() . '/library/functions/');
}

require_once( get_template_directory() . '/library/functions/options-framework.php' );
require_once( get_template_directory() . '/library/functions/basic-functions.php' );
?>

how i canhged it? and what i put ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.