Home Forums WoodMart support forum Problem with translations

Problem with translations

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #581184

    pablovilc
    Participant

    Hi

    I have a problem with woocommerce domain translations rendering from the woodmart theme.

    My site is in spanish, and all woodmart translations are working, but references to woocommerce strings like “__(‘test’, ‘woocommerce’)” are not loading.

    When I change the theme to Default wordpress 24th all woocommerce translations are rendering without problems…

    In short, when I activate woodmart, instances to other translation domains that do show up both in the wordpress panel and with other themes are not rendering correctly.

    Thanks in advice

    #581243

    Hung Pham
    Keymaster

    Hi pablovilc,

    Thanks for reaching to us.

    + In order to change / translate words. Please make sure you synced the strings first before changing / translating WooCommerce, WoodMart Core plugins and WoodMart theme. You can refer to article https://xtemos.com/docs-topic/theme-translation/

    + You are also need to select the language for the backend and theme settings for admin from the admin user profile, please edit the user’s profile and then select the language for that user it will show the same on the backend.

    Regards,

    #581338

    pablovilc
    Participant

    Hello Hung,

    Thanks for the answer, but I don’t think I have explained myself well….

    Both the website and the users have correctly assigned the Spanish language and all the translation files are correctly uploaded, in the wordpress backend all the strings are in Spanish and, if I activate the Twenty Twenty-Four theme the strings in the frontend are correctly displayed in Spanish (I attach a screenshot of the cart page so you can check it, img1).

    However, when I activate woodmart, the strings that belong to the woocommerce domain (such as “Your cart is currently empty.”) which is translated with any other theme, are not translated (img2). Only the strings that appear in the code under the domain ‘woodmart’ are being translated.

    In other words, the problem only appears when Woodmart is activated.

    Thanks in advance

    Attachments:
    You must be logged in to view attached files.
    #581427

    Hung Pham
    Keymaster

    Hi pablovilc,

    To assist you in the best possible manner, I kindly ask that you please provide me temporary wp-admin info (wp-admin URL, username, password) to the Private Content area, this will allow me to thoroughly investigate and address your concerns more efficiently.

    Regards,

    #581725

    pablovilc
    Participant

    Hello Hung,

    Private content info is on private area,

    Thanks

    #581828

    Hung Pham
    Keymaster

    Hi pablovilc,

    Try to add the following PHP code snippet to the child theme functions.php file to fix this

    if ( ! function_exists( 'woodmart_wc_empty_cart_message' ) ) {
    	/**
    	 * Show notice if cart is empty.
    	 *
    	 * @since 1.0.0
    	 */
    	function woodmart_wc_empty_cart_message() {
    		woodmart_enqueue_inline_style( 'woo-page-empty-page' );
    
    		?>
    		<p class="cart-empty wd-empty-page wc-empty-cart-message">
    			<?php echo wp_kses_post( apply_filters( 'wc_empty_cart_message', __( 'Your cart is currently empty.', 'woocommerce' ) ) ); ?>
    		</p>
    		<?php
    	}
    
    	add_action( 'woocommerce_cart_is_empty', 'woodmart_wc_empty_cart_message', 10 );
    }

    Kind Regards,

    #581849

    pablovilc
    Participant

    Hello Hung,

    It does not work… but if I change “woocommerce” domain on:

    <?php echo wp_kses_post( apply_filters( ‘wc_empty_cart_message’, __( ‘Your cart is currently empty.’, ‘woocommerce’ ) ) ); ?>

    for

    <?php echo wp_kses_post( apply_filters( ‘wc_empty_cart_message’, __( ‘Your cart is currently empty.’, ‘woodmart’ ) ) ); ?>

    it works…

Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)