• Resolved nielsverwaal

    (@nielsverwaal)


    This is really frustrating. Using Dutch Language, playing around with the default installation of StoreFront. It doesn’t seem to translate the section titles properly and I can’t find out what’s going on here. For example: The output code:
    —————————–
    <section class="storefront-product-section storefront-on-sale-products" aria-label="Producten in de uitverkoop"><h2 class="section-title">On sale Products</h2>
    —————————–
    The aria-label is fine, translates well, but the content in the h2 section-title doesn’t translate. As said, tried to find this in the code, but no luck. In storefront-template-functions.php found in storefront/inc/ the only reference I could find was this:
    —————————–

    echo '<section class="storefront-product-section storefront-on-sale-products" aria-label="' . esc_attr__( 'On Sale Products', 'storefront' ) . '">';
    
    				do_action( 'storefront_homepage_before_on_sale_products' );
    
    				echo '<h2 class="section-title">' . wp_kses_post( $args['title'] ) . '</h2>';

    etc…
    ——————————————

    As you can see, aria-label is translated correctly but between the h2 section-title tag it says: wp_kses_post( $args['title'] )

    Where do I translate this? What am I not seeing? How’s this done?

    Very eager for an answer, anyone?

    Thanks in advance, much appreciated,

    Regards,

    Niels

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter nielsverwaal

    (@nielsverwaal)

    Okay, What I’ve done is the following. I think it’s a bug in the original code.
    I.e. I replaced the instance of wp_kses_post( $args['title'] ) with esc_attr__( 'Product Categories', 'storefront' ) in the file inc/storefront-template-functions.php and saved this file in my Storefront Child-Theme folder under a new dir “inc”.
    Then in my chil-theme functions file I added:
    require 'inc/storefront-template-functions.php';
    And it worked! The bug was fixed with this solution, but is this the right way to do it? And if not, what would be the proper fix?

    Regards,

    Niels

    Job a11n

    (@jobthomas)

    Automattic Happiness Engineer

    Hi @nielsverwaal – I’ve just installed Storefront from scratch on a website that had Dutch as language and here it works fine:

    I’m not entirely sure what went wrong with your installation.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘h2 section title “On Sale Products” not translating. (StoreFront)’ is closed to new replies.