Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

This topic contains 5 replies, has 2 voices.

Last updated by Andreas W. 1 year, 1 month ago.

Assisted by: Andreas W..

Author Posts
April 5, 2024 at 11:32 am #15487734

br.-nirmalanandaY

I am using Max MegaMenu Plugin to build the menu on our website. Our website exists in 4 languages - English, Hindi, Tamil, and Telugu.

We have created a menu for the main English page and then translated it for the above-mentioned languages. On desktop view, the menu appears perfectly.

However, in the mobile view, the Toggle Text for the Menu is still coming in English for all the translated languages (screenshots attached below). In the WPML string translation, the toggle menu text is not reflected for the "mega menu" domain.

We had reached out to the Max MegaMenu Plugin support and they suggested using the WPML shortcode plugin. We explored and found out that the plugin is too old (The last update was made almost 8 years back!).

Then we found some similar PHP snippet that registers a string with the WPML for translation and we were successful in doing that. Following is the snippet which we used:

function register_my_strings() {
if (function_exists('icl_register_string')) {
icl_register_string('megamenu', 'MENU', 'MENU');
}
}

add_action('init', 'register_my_strings');

This snippet registered the string successfully and we could translate it also. However, the toggle text is still coming in English in the mobile menu in translated languages.

Description of Screenshots attached below:
#1 - Shows how the Mobile Menu has been created (along with the Toggle Text)
#2 - Shows that toggle text "MENU" is registered with the WPML string translation using the above PHP snippet and has been translated into Hindi Language
#3 - Shows the mobile menu in which the Toggle Text is still showing up even after translating the registered text through WPML String Translation in Step#2

Kindly help with this. It will be deeply appreciated.

Thanks!

3. ODK Hindi Page.png
2. WPML String Translation - Registered Text.png
1. Max Mega Menu - Toggle Menu Text Translation Issue.png
April 6, 2024 at 1:41 pm #15490647

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Thank you for reaching out and providing the screenshots.

According to what I see, it seems not to be the string that you need to translate.

You have to search for the complete string, including the applied HTML markup.

Please try to go to WPML > String Translation and at the bottom of the page click "Translate texts in admin screens".

Now search for the exact string, mark it, use the button to add it to String Translation, and translate it.

This should usually do the job. If this will not solve the issue, please let me know.

Regarding your custom code approach:

This function is deprecated. The code that you are displaying to register this string in this way does not show how you are displaying it on Frontend.

You need to use this hook instead to register a string:
https://wpml.org/wpml-hook/wpml_register_single_string/

This hook is dedicated to retrieving a string:
https://wpml.org/wpml-hook/wpml_translate_single_string/

Best regards
Andreas

April 8, 2024 at 7:22 am #15492754

br.-nirmalanandaY

Hi Andreas!

Hope you are having a nice day!

I tried the following which you suggested:

Please try to go to WPML > String Translation and at the bottom of the page click "Translate texts in admin screens".

Now search for the exact string, mark it, use the button to add it to String Translation, and translate it.

But I was not able to find the string.

Will you kindly help me further to solve this issue?

Thanks and Regards.

April 9, 2024 at 1:48 pm #15499523

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I would like to offer to have a closer look at the problem and request temporary access (wp-admin and FTP) to the website to investigate this issue further.

You can find the required fields below the comment section when you log in to leave the next reply. The information you provide is private, which means only you and I can see and access it.

IMPORTANT
Please be sure to make a backup copy of the website and database before allowing us access.
If you can't see the wp-admin / FTP fields, your post and website credentials are set as PUBLIC. DO NOT publish the data unless you see the required wp-admin / FTP fields.

The private response form looks like this:
hidden link

Next time you reply, click "I still need assistance."

Video:
hidden link

Please note that we are obliged to request this information individually on each ticket. We may not access any access information not specifically submitted on this ticket in the private response form.

Best regards
Andreas

April 18, 2024 at 5:08 pm #15540450

br.-nirmalanandaY

Hi Andrew,

Thanks for your reply. I will create the same and share with you!

Regards.

April 18, 2024 at 8:35 pm #15541018

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Thank you very much for your cooperation!

The private reply form is now enabled again.

The topic ‘[Closed] Toggle Menu Text Not Translatable for Mobile View’ is closed to new replies.