load_textdomain won't load my .mo file

I am using Yoast' method to build an HTML site map. But it needs to be translated.

It uses a page template page-sitemap.php that uses a template part

?php get_template_part('/partials/sitemap');  ?

In this template part I...

load_textdomain( 'site-map', TEMPLATEPATH.'/partials/languages' );

The path is right for I list the files of the folder TEMPLATEPATH.'/partials/languages' and it shows my language files.

As you see my domain name is 'site-map'. My .mo file is site-map-fr_FR.mo.

Why can't it be loaded?

Thanks for any clue, nicolas

Topic sitemap translation templates Wordpress

Category Web


I found the answer: load_textdomain( 'site-map', TEMPLATEPATH.'/partials/languages' ); ... gives the path of the folder containing the .mo file. but the path of every individual mo file should be used in its own load_textdomain instruction :

load_textdomain('site-map', TEMPLATEPATH.'/partials/languages/site-map-fr_FR.mo'); 
load_textdomain('site-map', TEMPLATEPATH.'/partials/languages/site-map-en_US.mo'); 
load_textdomain('site-map', TEMPLATEPATH.'/partials/languages/site-map-es_ES.mo'); 
load_textdomain('site-map', TEMPLATEPATH.'/partials/languages/site-map-ru_RU.mo'); 
load_textdomain('site-map', TEMPLATEPATH.'/partials/languages/site-map-de_DE.mo');

Shame on me it is a very obvious and useless thread ... Sorry!

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.