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. Commented Aug 16, 2015 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
    Commented Aug 17, 2015 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
    Commented Aug 17, 2015 at 17:44

1 Answer 1

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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