Home Forums WoodMart support forum Can you make secondary button mobile menu translatable with WPML

Can you make secondary button mobile menu translatable with WPML

Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #452813

    tim.meulendijk
    Participant

    Navigate to “wp-content/themes/woodmart/inc/template-tags/template-tags.php” line no 1781, and replace:

    <?php echo esc_html( $secondary_menu_title ); ?>

    with:

    <?php echo esc_html__( $secondary_menu_title, ‘woodmart’ ); ?>

    Now i can translate secondary button of the mobile menu, but i don’t want to lose this setting with the next update of Woodmart. Can this be integrated into the theme?

    Kind regards Tim

    #452909

    Artem Temos
    Keymaster

    Hello,

    It has default titles that work with translation when there are no texts specified in the element. So you need to leave the fields empty if you want to use your translations https://monosnap.com/file/KHJV1sAAUEF1emIs5OF91ZsD48xGbC

    Kind Regards

    #453040

    tim.meulendijk
    Participant

    Hi Support,

    But i have added a custom title in the header builder for the secondary button in the mobile menu and i tried everything but the translation don’t work.

    For example secondary button i want this:

    EN: Magnets
    NL: Magneten
    DE: Magnete

    I tried everything. Thats why i contacted WPML developers. They installed a staging and tested and came up with this solution. Before WPML couldn’t pick up the translation of the secondary button.

    And yes i have seen the string registrations that Woodmart uses for the primary and secondary buttons but they are not working. I translated them before i contacted WPML and they were translated but at the frontend the translation wasn’t showing.

    Kind regards,

    Tim

    #453050

    Artem Temos
    Keymaster

    Hello,

    Please, disable all plugins that are not related to our theme and provide us with your admin and FTP access. We will log in and check what is wrong there. You can leave only the following plugins that are required for our theme:
    WoodMart core
    WooCommerce
    Elementor/WPBakery page builder

    Thank you in advance

    #453071

    tim.meulendijk
    Participant

    Keep in mind that i already have added the line of-code:

    <?php echo esc_html__( $secondary_menu_title, ‘woodmart’ ); ?>

    in the:

    wp-content/themes/woodmart/inc/template-tags/template-tags.php” line no 1781

    So for testing purposes i kept some plugins on but most of them are off.
    These plugins are essentials to me and don’t conflict. You need WPML activated to properly test it.

    #453075

    Artem Temos
    Keymaster

    Please, restore the theme’s original code so we can check why the translations don’t work as supposed to.

    #453077

    tim.meulendijk
    Participant

    I did that just now.

    And now the translation is indeed not showing anymore.

    #453079

    Artem Temos
    Keymaster

    Sorry, but the password seems to be wrong and we can’t access your dashboard https://gyazo.com/1f6a2922f6cde26c1aaa3ca6db20cea6

    Kind Regards

    #453080

    tim.meulendijk
    Participant

    Update

    #453092

    Artem Temos
    Keymaster

    You can translate it now in String translation as shown on the screenshot https://gyazo.com/bd469b641b8b53bed044e2911dd4c0b9
    As for the English version, you need to create a new translation with Loco Translate plugin and change the English version of the “Categories” text.

    #453102

    tim.meulendijk
    Participant

    Thank you for your time. Really appreciate it.
    I have seen your solution.
    But are you now saying that i need to install another plugin to translate 1 string so that i can translate it with WPML? While i just gave you the solution to always directly use it with WPML, so that the string can be seen right away by WPML and all your customers that use WPML can actually use the Custom Name for the secondary button. I think this is a strange fix you give me while the solution i gave you works better and is more user friendly. Loco Translate is one extra plugin that i need to install. And i need to be smart about the number of plugins i have activated because in no time you can have to many plugins active.

    Kind regards,

    Tim

    #453105

    Artem Temos
    Keymaster

    You don’t need to keep this plugin. You just need to create an English translation file and then you can uninstall it.

    The fix provided by you is a bit dirty workaround because the translation function shouldn’t contain variables.

    #453107

    tim.meulendijk
    Participant

    Thanks! Great help for understanding it all.

    #453112

    tim.meulendijk
    Participant

    Will this be overwritten with next Woodmart update?

    #453140

    tim.meulendijk
    Participant

    When i put the translation files in the child theme, the translation doesn’t work for the main language where i try to rename Categories into Magnets. the other translations do work because they are set with WPML.

    So now i have them in themes/woodmart/languages/en_US.po

    #453265

    Artem Temos
    Keymaster

    Hello,

    The translation file should be located in the folder wp-content/languages/themes/.

    Kind Regards

    #453708

    tim.meulendijk
    Participant

    Thanks again!

    I have one small negative thing to say. I love the support and the theme. But i cannot understand that both Xtemos and WPML say you are 100% compatible with each other but a few small things like translating the secondary button or the NEW, SALE, HOT labels can not be translated with WPML. For this you need Loco Translate. And in my opinion this is a little nuts of course. I use WPML with all of its plugins and there are too many of them is opinion but ok and then for just a few strings i need also to install Loco Translate to install 3 language files for just 4 or 5 strings and then delete Loco Translate again. This is a little strange in my eyes.

    #453795

    Artem Temos
    Keymaster

    Hello,

    Actually, this option can be translated to other languages with WPML without any problems. The problem is that you want to change the default English version and WPML doesn’t allow you to do so for some reason. That is why you need to create a separate translation file for this.
    As for the compatibility with WPML, we are always in touch with the plugin developers team in case any issues occur. We are also discussing this point with WPML developer at the moment to see how to make this option work better in the future.

    Kind Regards

    #453878

    tim.meulendijk
    Participant

    Yes i know… i saw the string ‘Categories’ for the secondary button in the tempate-tags.php.

    I bought especially Woodmart because it works with WPML and also bought WPML and WP Rocket and WooCommerce Tiered Pricing Table just to be sure that i have good plugins and with support.

    Thanks again

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