Home Forums WoodMart support forum Problem with translations

Problem with translations

Viewing 16 posts - 1 through 16 (of 16 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…

    #582005

    Hung Pham
    Keymaster

    Hi pablovilc,

    Glad to hear your issue has been resolved. Keep us in mind for future questions and concerns, we’re always here to help!

    Regards,

    #582021

    pablovilc
    Participant

    Hi Hung,

    No it is not solved, because there are a lot of string that are on woocommerce domain (like return to shop, addresses fields, etc), we cannot change all of this. Woodmart should load all woocommerce domain translations (as every other theme does…)

    #582243

    Hung Pham
    Keymaster

    Hi pablovilc,

    To assist you in the best possible manner, I kindly ask that you please provide me screenshots that illustrate the problem on the front-end to the Private Content area, this will allow me to thoroughly investigate and address your concerns more efficiently.

    Regards,

    #582280

    pablovilc
    Participant

    Hi,

    The problem is that Woodmart child theme is not loading translations in woocommerce_es-ES.mo and .po files.

    If you change the theme, or look in the backend, the strings in those .mo and .po files do load, so they are correct.

    In the img1 you can see how the default string ‘Your cart is currently empty.’ is not translated if the domain string in the img2 is ‘woocommerce’ (that string is correctly translated in the .mo and .po and if the default WordPress theme is activated it appears translated).

    However, if the domain string is changed to ‘woodmart’ (img4) it is translated correctly.

    In conclusion, with the Woodmart theme active the translations of the Woocommerce .mo and .po files are not loaded, while if you activate another theme or take a look at the backend all the strings are translated correctly.

    Thanks in advance

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

    Hung Pham
    Keymaster

    Hi pablovilc,

    Would you mind if I deactivate extra plugins for testing? Please confirm me back.

    Regards,

    #582371

    pablovilc
    Participant

    Of course, you can do it, but please, activate them after your tests if you dont mind

    Thanks!

    #582592

    Hung Pham
    Keymaster

    Hi pablovilc,

    When I deactivated Contact Form 7 and translation appeared well, it seems strange.

    Please backup your contact form > delete the plugin and try to re-install it.

    Regards,

    #582621

    pablovilc
    Participant

    Hello hung!

    Thank you very much! it is one of the few plugins that we have not deactivated in our tests because they have never caused us problems…

    Thank you very much, we will investigate what happens with contact form and we will fix it.

    Thank you!

    #582659

    Hung Pham
    Keymaster

    Hi pablovilc,

    Keep us in mind for future questions and concerns, we’re always here to help!

    Regards,

Tagged: 

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