WordPress.org

Ready to get started?Download WordPress

Forums

Expound
[resolved] My Child Theme's translation is not working (5 posts)

  1. DJviolin
    Member
    Posted 8 months ago #

    Hi! I created this child theme: LINK

    But the translation is not working. :( I followed WordPress Codex.

    Also the favicon is pointing my localhost's server home directory.

    Thank You for your help!

  2. DJviolin
    Member
    Posted 8 months ago #

    This is the code:

    function expound_child_setup() {
    	/**
    	 * Make theme available for translation
    	 * Translations can be filed in the /languages/ directory
    	 * If you're building a theme based on Mag, use a find and replace
    	 * to change 'expound' to the name of your theme in all the template files
    	 */
    	load_child_theme_textdomain( 'expound-child', get_stylesheet_directory_uri() . '/languages' );
    }
    add_action( 'after_setup_theme', 'expound_child_setup' );

    My upper link updated, favicon problem solved. But Hungarian translation files in expound-child/languages directory still don't work, but works in original theme directory.

  3. DJviolin
    Member
    Posted 8 months ago #

    I modified my child theme: LINK

    I included a javascript line (delete '#' string from menu links), but seems like not responding. .js file presented in source code. Translation still not working. What's wrong? WP related issue?

  4. DJviolin
    Member
    Posted 8 months ago #

    It works with external child CSS:

    nav ul li a[href='#'] { pointer-events: none; cursor: default; }

    But not with externel child JS file:

    $(document).ready(function(){
    //$("nav ul li a[href='#']").removeAttr("href").css("cursor","pointer");
    });

    Strange. I think it's WP related.

  5. Konstantin Kovshenin
    Member
    Theme Author

    Posted 7 months ago #

    Hey there, I think child theme textdomains are for additional strings in the child theme. If you'd like to provide a translation for the original strings, your text domain should match, i.e. expound, not expound-child in load_child_theme_textdomain. Also, if you want to provide additional translation files without breaking the theme on updates, you can just put them in wp-content/languages/themes/expound and it should all just magically work :)

    Hope that helps!

Reply

You must log in to post.

About this Theme

About this Topic