WordPress.org

Ready to get started?Download WordPress

Forums

translating default mo file (1 post)

  1. erwanpia
    Member
    Posted 2 years ago #

    Hi, I would like to have default translations in my theme

    that involves redefining location of languages folder in functions.php (because I only want to do this for a specific theme)

    I have tried a few hours but can't find the solution

    anybody can figure this out ? here is what I have tried:

    add_action('wp_loaded', 'my_theme_setup', 0);
    function my_theme_setup(){
        load_theme_textdomain('default', get_template_directory() . '/languages/');
       // echo get_template_directory() . '/languages';
     define( 'WP_LANG_DIR',  get_template_directory() . '/languages/' );
    
    }

Topic Closed

This topic has been closed to new replies.

About this Topic