Translated a theme, created .mo file, and what now? (3 posts)

  1. sjogro
    Posted 6 years ago #

    Hi, I went through this tutorial to translate a theme. I did it! I know have a .mo and a .po file for dutch localization (nl-NL.mo and nl-NL.po). Now how do I get the theme to display localized ??

    I read a comment about <?php load_theme_textdomain( $domain, $path ) ?> but I didn't get it.


  2. Yakir
    Posted 5 years ago #

  3. Reuben Gunday
    Posted 5 years ago #

    Here is an example of how to use it.
    Place it in your functions.php file.
    <?php load_theme_textdomain('unique-identifier',get_template_directory() . '/languages'); ?>

    save your .mo files in languages folder in your themes folder.
    .mo file should be named based on locale. For example pt_BR.mo will be for Brazilian Portuguese. To know the name of locale you are using just use echo get_locale();.

Topic Closed

This topic has been closed to new replies.

About this Topic