Translating wordpress theme

I want to load my language files into the wordpress template. For this , I have created a folder called (languages) in the template root. Also I have generated the (*.po , *.mo) files for the language inside that directory.

I have added this code to the functions.php file :

Read More
    load_theme_textdomain( 'mytheme', TEMPLATEPATH.'/languages');

    $locale_file = TEMPLATEPATH."/languages/$locale.php";
    if ( is_readable($locale_file) )
    {
        require_once($locale_file); 
    }

The name of my language files are (ar.po,ar.mo). So I have tried using this line :

_e("home","mytheme");

but nothing replaced , the text still as the same. What is the problem ?

Related posts

Leave a Reply

1 comment

  1. I am not sure if this is the problem, but the language support must be enabled in wp-config.php too.

    Example:

    define('WPLANG', 'bg_BG');
    define('WP_LANG_DIR', $_SERVER['DOCUMENT_ROOT'].'wordpress/languages');
    

    Copied from here:

    WPLANG defines the name of the language translation (.mo) file.
    WP_LANG_DIR defines what directory the WPLANG .mo file resides. If
    WP_LANG_DIR is not defined WordPress looks first to
    wp-content/languages and then wp-includes/languages for the .mo
    defined by WPLANG file.