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.

This topic contains 4 replies, has 2 voices.

Last updated by Noman 1 year, 5 months ago.

Assigned support staff: Noman.

Author Posts
May 9, 2018 at 8:57 pm #2061540

Michelle Furman

Tell us what you are trying to do? Our goal is to have ​the "MENU" next to the Hamburger Icon (on mobile), translate when languages are switched. They main (non mobile) menu translates accordingly now without any issues.

Is there any documentation that you are following? no

Is there a similar example that we can see? no

What is the link to your site? fyrquel.com

May 9, 2018 at 9:00 pm #2061545

Michelle Furman

Please also note there is a change to the email on the account.. If this can please be sent to the new address on file that would be great. Thanks again

May 10, 2018 at 12:07 pm #2070668

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. You need to wrap the ‘MENU’ string in the _e() functions with a text domain like 'themedomain’, So that, your string will be look something like this:

<?php  _e('MENU', 'themedomain'); ?>

Then you need to scan the theme again in WPML >> Theme and plugins localization and translate this string under WPML >> String Translation.

Here is doc for more details:
https://codex.wordpress.org/I18n_for_WordPress_Developers https://codex.wordpress.org/Function_Reference/_2

If still issue persists, please add the debug report in the Debug Information box. I have also enabled debug info box for your next reply: https://wpml.org/faq/provide-debug-information-faster-support/

Thank you

May 10, 2018 at 2:20 pm #2074130

Michelle Furman

Thank you for your help so far on this.. I added the string to the menu (see screenshot) but when I go to scan the string, it will not allow me to... Please let me know what I am doing incorrectly... Of if you offer services (paid) to make this update.. Thanks

May 10, 2018 at 4:05 pm #2076724

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

It seems you are not using String Translation plugin for translating strings. So, You can use ‘ICL_LANGUAGE_CODE’ constant to get current language code.

Please use following PHP code to display language specific content:


<?php if(ICL_LANGUAGE_CODE == 'en'){ ?>
                    	MENU (english)
<?php } elseif(ICL_LANGUAGE_CODE == 'fr'){ ?>
                    	MENU (french)
<?php } elseif(ICL_LANGUAGE_CODE == 'es'){ ?>
                    	MENU (spanish)
<?php }  elseif(ICL_LANGUAGE_CODE == 'de'){ ?>
                    	MENU (german)
<?php } ?>

I hope it helps,

Thank you

The topic ‘[Closed] Mobile Menu Issue’ is closed to new replies.