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 5 replies, has 2 voices.

Last updated by drK-2 1 week, 6 days ago.

Assigned support staff: Noman.

Author Posts
September 14, 2019 at 10:45 pm #4573287

drK-2

We went through all the documentation of adding the button on top of the header on mobile but without success. Any help is appreciated.

September 16, 2019 at 8:03 am #4577103

Noman
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML Support. Do you want to translate ‘Sign up’ and ‘Login’ buttons as you can see in the attached screenshot?

If yes then to take a closer look on this issue, please provide temporary access (WP-Admin and FTP Login info) to your site, so that I can look into your setup and debug the issue.

Your next answer will be private which means only you and I have access to it.

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

Thank you

September 17, 2019 at 8:32 am #4586373

Noman
Supporter

Languages: English (English )

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

I have logged in to your site and followed below steps:

1. I have wrapped the strings in the gettext functions __() with a text domain and replaced below code:

function hook_for_header_top_signup_login_btn() {
 echo '<a class="header_top_signup_login_btn" href="<em><u>hidden link</u></em>">Sign Up</a>';
 echo '<a class="header_top_signup_login_btn" href="<em><u>hidden link</u></em>" target="_blank">Login</a>';
}
add_action( 'et_header_top', 'hook_for_header_top_signup_login_btn' );
}

With:

function hook_for_header_top_signup_login_btn() {
 echo __('<a class="header_top_signup_login_btn" href="<em><u>hidden link</u></em>">Sign Up</a>', 'themedomain');
 echo __('<a class="header_top_signup_login_btn" href="<em><u>hidden link</u></em>" target="_blank">Login</a>', 'themedomain');
}
add_action( 'et_header_top', 'hook_for_header_top_signup_login_btn' );

In functions.php file.

2. Scan the theme from WPML >> Theme and plugins localization section.
3. Then searched strings from WPML >> String Translation and added it’s translation.

Now it showing correct translation as you can see in the attached screenshot.

Thank you

September 17, 2019 at 8:48 am #4586585
drK-2

Perfect, thank you very much!

One more question, how do we translate the cookie warning pop up? We also want to localize it based on the browser language of the users.

New threads created by Noman and linked to this one are listed below:

https://wpml.org/forums/topic/we-want-to-translate-the-cookie-warning-pop-up/

September 27, 2019 at 6:17 am #4651829

Noman
Supporter

Languages: English (English )

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

[ status changed ]

September 30, 2019 at 2:57 pm #4665757

drK-2

My issue is resolved now. Thank you!