• Hi all,

    I’m trying to apply theme localization. I followed the steps below to generate a .pot file and a .mo file.

    Copied my theme into poedit/bin/ directory and fired up PoEdit and made a New Catalog. In “Paths”, I have chosen ./ as base path and ..(double dot) as Paths. Next inside “Keywords”, I have deleted the available ones and added _e and __(two underscores).

    This means the .po file will be created with ../ as base directory. Which is fine, since I want to put the .mo file in themes/yourtheme/languages folder.

    So I created that folder languages and copied the .mo file there. Then I modified my header adding the following code:


    <?php load_theme_textdomain('theme_name', get_template_directory() . '/languages'); ?>

    From what I understand this is it, however, the .mo file is never loaded. The strings are not translated, so clearly I’m missing something here. Any help is appreciated.

The topic ‘Theme localization’ is closed to new replies.