views:

35

answers:

1

Hi,

I have a wordpress theme without textdomain (i.e. e(x) and not e(x,domain)). I also have the .po and .mo files in a folder under /themes/My Theme/localization (Notice the space name in the my theme). I would like to activate fr_FR. I created fr_FR.po and .mo and changed the wp-config to add the locale for fr_FR. However, I am still not getting the french to work. I saw many sites telling you to add a load_theme_textdomain at the top of functions.php, but I do not know what would my textdomain be. Any help will be appreciated.

Youssef

A: 

To get theme localization working, you're going to need to go through your theme and add a domain to every _e() and __() function call. this:

_e('some text');
__('some other text');

Will have to become this:

_e('some text', 'your-domain');
__('some other text', 'your-domain');

Next you'll need to add this bit of code at the top of your functions.php file:

load_theme_textdomain( 'your-domain', TEMPLATEPATH.'/localization' );

$locale = get_locale();
$locale_file = TEMPLATEPATH."/localization/$locale.php";
if (is_readable($locale_file))
    require_once($locale_file);

You can read more about it in this post.

Pat
I really appreciate your answer. Before I do it the way you recommend, I would like to hear from the rest of the community to confirm that there is no easy way. :(
I tried what you suggested, but no success! Any ideas?