• ergoticpsilocineyeoftheabsolute

    (@ergoticpsilocineyeoftheabsolute)


    Hello there

    Is this translating code all okay? I have MO generated with Loco Translate but it refuses to do the tricks with me.

    In footer.php:

    $anchor = esc_html_x( 'Link', 'link text for Link', 'my-theme' );
            $domain = esc_url( __( 'https://myaddress.com', 'my-theme' ) );  
            $link   = sprintf( '<a href="%s" rel="noopener" target="_blank">%s</a>', $domain, $anchor );
            echo sprintf( esc_html__( ' Check this %1$s', 'my-theme' ), $link );
    

    In my-theme.pot file:

    #: footer.php:56
    msgid "Link"
    msgstr ""
    
    #: footer.php:59
    msgid " Check this %1$s"
    msgstr ""
    

    In functions.php file:

    
    function my_theme_textdomain() {
        load_theme_textdomain( 'my-theme', get_template_directory() . '/languages' );
    }
    add_action( 'after_setup_theme', 'my_theme_textdomain' );
    
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problems with translating text including hyperlink’ is closed to new replies.