• Resolved Rakshasi

    (@rakshasi)


    So… I’m doing my own theme here and wanted to translate it into finnish. However, reviewer asked me to put load_theme_textdomain into function so I did what I was told and put it in my setup() function. After that my translation stopped working and everything is in english, no matter what I do.

    I tried to also change it back the way it was but that solution stopped working as well so I started thinking if the problem is my textdomain itself but since I was asked to change it too that can’t be the problem right? Code I’m using looks like this:

    //Defines textdomain for theme
    	load_theme_textdomain('nature-light', get_template_directory_uri() . '/lang' );
    
    //Loading language file
    	$locale = get_locale();
    	$locale_file = get_template_directory_uri() . "/lang/$locale.php";
    	if (is_readable($locale_file))
    		require_once($locale_file);

    Any idea what I could do to solve this?

Viewing 1 replies (of 1 total)
  • Thread Starter Rakshasi

    (@rakshasi)

    Solved. Managed to put it in setup and noticed there was writing mistake when I first tried. For someone else looking for answer in similar problem, my final code looks like this:

    //Setup function
    function nature_light_setup() {
    //Defines textdomain used in this theme
    	load_theme_textdomain('nature_light', get_template_directory() . '/lang' );
    }
    add_action('after_setup_theme', 'nature_light_setup');
Viewing 1 replies (of 1 total)
  • The topic ‘Language files aren't working’ is closed to new replies.