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
- This topic has 18 replies, 2 voices, and was last updated 1 year, 11 months ago by
tim.meulendijk.
-
AuthorPosts
-
March 21, 2023 at 1:11 am #452813
tim.meulendijkParticipantNavigate 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
March 21, 2023 at 10:39 am #452909
Artem TemosKeymasterHello,
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
March 21, 2023 at 2:23 pm #453040
tim.meulendijkParticipantHi 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: MagneteI 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
-
This reply was modified 1 year, 11 months ago by
tim.meulendijk.
March 21, 2023 at 3:01 pm #453050
Artem TemosKeymasterHello,
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 builderThank you in advance
March 21, 2023 at 3:57 pm #453071
tim.meulendijkParticipantKeep 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.March 21, 2023 at 3:59 pm #453075
Artem TemosKeymasterPlease, restore the theme’s original code so we can check why the translations don’t work as supposed to.
March 21, 2023 at 4:02 pm #453077
tim.meulendijkParticipantI did that just now.
And now the translation is indeed not showing anymore.
March 21, 2023 at 4:04 pm #453079
Artem TemosKeymasterSorry, but the password seems to be wrong and we can’t access your dashboard https://gyazo.com/1f6a2922f6cde26c1aaa3ca6db20cea6
Kind Regards
March 21, 2023 at 4:04 pm #453080
tim.meulendijkParticipantUpdate
March 21, 2023 at 4:21 pm #453092
Artem TemosKeymasterYou 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.March 21, 2023 at 4:42 pm #453102
tim.meulendijkParticipantThank 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
March 21, 2023 at 4:46 pm #453105
Artem TemosKeymasterYou 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.
March 21, 2023 at 4:47 pm #453107
tim.meulendijkParticipantThanks! Great help for understanding it all.
March 21, 2023 at 5:15 pm #453112
tim.meulendijkParticipantWill this be overwritten with next Woodmart update?
March 21, 2023 at 6:32 pm #453140
tim.meulendijkParticipantWhen 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
March 22, 2023 at 10:18 am #453265
Artem TemosKeymasterHello,
The translation file should be located in the folder
wp-content/languages/themes/
.Kind Regards
March 23, 2023 at 6:13 pm #453708
tim.meulendijkParticipantThanks 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.
March 24, 2023 at 9:25 am #453795
Artem TemosKeymasterHello,
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
March 24, 2023 at 2:26 pm #453878
tim.meulendijkParticipantYes 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
-
This reply was modified 1 year, 11 months ago by
-
AuthorPosts
- You must be logged in to create new topics. Login / Register