• Hello,

    I have a bug report for the theme Sydney.

    I use a child theme of Sydney.

    The phrase “Comments” on a blog post is not translated into German on the archive page or on a single blog post page.

    I have checked the language files several times in the Loco Translate plugin and locally with PoEdit. The term “% Comments” is correctly translated to “% Kommentare”.

    I can go two ways to tell the WP system to access the language files:

    1. Language files in the folder wp-content/languages/themes/sydney-child-theme/languages and the hint for the system with an appropriate PHP code in functions.php.

    2. Language files in the folder wp-content/themes/sydney-child-theme/languages.

    Both do not work, the expression is not translated. There must be a bug in the Sydney theme here. It’s not Loco Translate or PoEdit, as these are just file editors.

    How do I solve the problem?

    Regards

    Thobie

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi Thobie,

    As checked from your site’s source code, it looks like you’re using Sydney child theme that is developed by someone else (not by us). Can you let me know how your child theme overrides the main theme’s files? Are the strings are translation-ready.

    Thread Starter Thobie

    (@thobie)

    Hello, Kharis,

    ?Can you let me know how your child theme overrides the main theme’s files?“

    I don’t know what that means that the child theme overrides the main theme’s files?

    ?Are the strings are translation-ready.“

    And I also dont’t know what that means.

    Regards

    Thobie

    Sorry for being unclear.

    ?Can you let me know how your child theme overrides the main theme’s files?“

    A child theme’s code can make particular code in the main theme not functioning for replacement. In your case, if you lose translation control for particular text from main theme’s, may be your child theme replaces the respective code where it should be translatable by default.

    Please take a look into your child theme’s code and check whether it has particular text that is shown in the front end or not.

    Are the strings are translation-ready.

    If you’ve added some text hard coded from child theme, to make it translatable, you have to follow special rules as mentioned in this section.

    Thread Starter Thobie

    (@thobie)

    Hello, Kharis,

    I use a child theme of sydney, sydney-child-theme. Created by the plugin Orbisius Child Theme Creator.

    I have created a folder ?sydney-child-theme“ in the folder ?themes“. In this folder I have created a folder ?languages“. And in this folder I have copied the translated files:

    de_DE.mo
    de_DE.po
    de_DE_formal.mo
    de_DE_formal.po
    sydney.pot

    I also have copied the files:

    extras.php
    template-tags.php

    from the parent theme into the new created folder ?inc“ in the folder ?sydney-child-theme“ because they are not existing in the child theme.

    And I have inserted the following php code into the functions.php of the child theme:

    /**
     * Loads the child theme textdomain.
     */
    function sydney_child_theme_setup() {
        load_child_theme_textdomain( 'sydney', get_stylesheet_directory() . '/languages' );
    }
    add_action( 'after_setup_theme', 'sydney_child_theme_setup' );

    One example: The string ?By“ (the author) cannot be translated in the language files because it doesn’t exist in this files. But it exists in the file extras.php. If translated in this file of the child theme to german ?Von“ it will be correctly shown in the frontend. But yesterday I have upgraded the parent theme to a newer version and now the translation has been disappeard and ?By“ appears once again in the frontend.

    That means the WordPress system doesn’t access the files of the child theme but the files of the parent theme?

    Hi,

    Thank you for getting back along with additional information.

    Please check your child theme’s template-tags.php file and check whether it has this code block (below) or not.

    if ( ! function_exists( 'sydney_entry_comments' ) ) :
    	function sydney_entry_comments() {
    		if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
    			echo '<span class="comments-link">';
    			comments_popup_link( esc_html__( '0 comments', 'sydney' ), esc_html__( '1 comment', 'sydney' ), esc_html__( '% comments', 'sydney' ) );
    			echo '</span>';
    		}		
    	}
    endif;

    If not, try replicating it and run your test.

    Thread Starter Thobie

    (@thobie)

    Hello, Kharis,

    the template-tags.php of the child theme has the following php code with the german translation of three english words:

    if ( ! function_exists( 'sydney_entry_comments' ) ) :
    	function sydney_entry_comments() {
    		if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
    			echo '<span class="comments-link">';
    			comments_popup_link( esc_html__( '0 Kommentare', 'sydney' ), esc_html__( '1 Kommentar', 'sydney' ), esc_html__( '% Kommentare', 'sydney' ) );
    			echo '</span>';
    		}		
    	}
    endif;
    Thread Starter Thobie

    (@thobie)

    Hello, Kharis,

    since I’ve been waiting for an answer from you for four days, but it hasn’t come, I assume that this is a bug in the theme, can’t be fixed and I have to live with it. Too bad. The theme is otherwise very good, only this small error clouds the whole thing but something.

    Regards

    Thobie

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Translation: Bug report.’ is closed to new replies.