• Resolved Avantart

    (@avantart)


    I translated tracks.pot from version 1.37.1 to de_DE-formal.po

    it is interpreted and working.

    Some strings are not translated, and I found out that these are the snippets from the file /content/further-reading.php which I manipulated to show the thumbnails of the posts,

    see here: https://www.urbanistan.de/wordWock/alter-wein-in-neuen-schlaeuchen/

    I checked that the relevant strings are contained in the language files and they do exist.

    Here is an example of my code:

    if ( $previous_blog_post ) {
    
    		if ( has_post_thumbnail ( $previous_blog_post->ID ) ) {
    		$previous_thumbnail = get_the_post_thumbnail( $previous_blog_post->ID, 'medium', array( 'class' => 'alignleft' )  );
    		echo "<p class='prev'>
    	            <span>" . __( 'Previous Post', 'tracks' ) . "</span>" . $previous_thumbnail .
    	            "<br/><a href='" . get_permalink( $previous_blog_post ) . "'>" . $previous_title . "</a>
    	        </p>";
    	}
    	else  {echo "<p class='prev'>
    	            <span>" . __( 'Previous Post', 'tracks' ) . "</span>
    	            <a href='" . get_permalink( $previous_blog_post ) . "'>" . $previous_title . "</a>
    	        </p>";}
    
    if (! $previous_blog_post ) {
    		echo "<p class='prev'>
    	            <span>" . __( 'This is the oldest post', 'tracks' ) . "</span>
    	            <a href='" . esc_url( home_url() ) . "'>" . __( 'Return to Blog', 'tracks' ) . "</a>
    	        </p>";
    	}
    	}

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Ben Sibley

    (@bensibley)

    Try adding the following to your child theme’s header in the style.css file:

    Text Domain: tracks

    That may be needed to get the theme to use the translations you have for Tracks.

    Thread Starter Avantart

    (@avantart)

    Ben,

    this snippet in the functions.php of the child-theme did the work:

    function my_child_theme_setup() {
        load_child_theme_textdomain( 'tracks', get_stylesheet_directory() . '/languages' );
    }
    add_action( 'after_setup_theme', 'my_child_theme_setup' );

    the additional info in the header of the style.css had no effect.

    Cheers, Connie

    Theme Author Ben Sibley

    (@bensibley)

    Nice, thanks for sharing the solution.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘language file not read everywhere’ is closed to new replies.