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 20 replies, has 3 voices.

Last updated by Carlos Rojas 5 months ago.

Assigned support staff: Carlos Rojas.

Author Posts
April 15, 2019 at 8:59 am

garryM-2

I am trying to to get the browser to redirect to the US English version when viewing it in a browser that has US English set as its language. It is working as expected for all other languages but not the custom US English language.

I have followed the solution in the following thread, but it still doesn't redirect. (https://wpml.org/forums/topic/cant-get-browser-language-redirect-to-work-on-us-site/)

I have attached an image of the fields used to create the custom US English language.

April 15, 2019 at 6:45 pm #3615851

Carlos Rojas
Supporter

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

Timezone: America/Montevideo (GMT-03:00)

Hello,
Thank you for contacting WPML support.

I kindly ask you to check if any of this issues is happening in the site: https://wpml.org/documentation/getting-started-guide/language-setup/automatic-redirect-based-on-browser-language/#debugging-browser-language-redirection

Kind regards,
Carlos

April 16, 2019 at 8:29 am #3619731

garryM-2

Hello,

I have checked through the link and unfortunately I still don't get redirected. The browser language is set to English(United States), the option to redirect in the WPML settings is checked, I always test it in incognito mode, there are no javascript errors and no other redirection plugins. The other language redirects work fine when I change the browser language, the only issue is the US English redirect.

April 16, 2019 at 4:11 pm #3623921

Carlos Rojas
Supporter

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

Timezone: America/Montevideo (GMT-03:00)

Hi there,
Thank you very much for your feedback.

I have visited the site again in incognito mode and I can see several Javascript errors in the browser console that might be causing this issue (see attached image). Could you tell me if you can see this errors too?

Regards,
Carlos

April 17, 2019 at 11:52 am #3630295

garryM-2

Hello,

I don't see those errors. See attached. I have also checked on 3 other machines and there are no Javascript errors.

April 17, 2019 at 2:22 pm #3631923

Carlos Rojas
Supporter

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

Timezone: America/Montevideo (GMT-03:00)

Hello,
Thank you very much for your message.

It seems that the issue is on my side. I asked a colleague from US to check the site and she doesn't get redirected. Before I escalate this ticket to our 2nd tier specialists I would like to ask you to activate the debug mode on the site following the steps described in this link: https://codex.wordpress.org/Debugging_in_WordPress and let me know if there is any error in the debug.log file within wp-content folder.

Looking forward to your answer.
Regards,
Carlos

April 17, 2019 at 3:56 pm #3632489

garryM-2

Hello,

I have followed the steps in the link and recreated the issue however a debug.log file isn't generated within the wp-content folder.

April 17, 2019 at 6:20 pm #3634205

Carlos Rojas
Supporter

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

Timezone: America/Montevideo (GMT-03:00)

Hi,

I'm consulting our specialists about this case.

In the mid time, I kindly ask you to follow this steps in order to isolate the cause of the issue:
- Back up your site first before making any change, this is for security reasons.
- Update all outdated plugins and themes.
- Flush any cache memory that might exists.
- Deactivate all the plugins that are not related to WPML.
- Switch for a moment to a WordPress default theme like Twenty Seventeen.
- If the issue is gone, activate one by one to see with which one there is an interaction issue.

Could you tell me the result of this steps?

Regards,
Carlos

April 18, 2019 at 10:26 am #3638261

garryM-2

Hi,

- All plugins are up to date.
- Before I try to recreate the issue I always flush the cache
- I have deactivated all plugins not associated with WPML and the issue still occurs.
- I have switched themes to WordPress Twenty Ninteen and the issue still occurs.

Each time I changed the setting/removed plugins, I also tested the redirect to one of the default WPML languages and it works as expected. The issue still remains with the custom US Language.

April 18, 2019 at 5:01 pm #3640961

Vincenzo
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello, my name is Vincenzo.
Since Carlos currently has a few days off, I will replace him here in the forum.
I hope this is OK with you.

I just tested your site and the redirect is working correctly for both EN-US and EN-GB

This is how I tested your site:

- Open Firefox
- Go to Options
- In the Language section press the "Choose..." button
- Add the English (United States) [en-us]
- Set it as the first language using the Move Up button
- Press OK
- Open a New private window
- Go to hidden link
You should be redirected to hidden link
The same will work correctly if you set the English (United Kingdom) [en-gb] as the first language.

If that is not happening, try these steps:
- Open the browser console (F12 key)
- Open the Storage tab
- Click on Cookies to open it
- Right click on your site's address and select "Delete All" to delete all cookies.
- Try again

It seems that the redirect is not working in the default language because the language is already English. This is a known issue and our developers are working on it.

Can you please tell me if you get the same results?

Thank you

April 19, 2019 at 12:11 pm #3645611

Vincenzo
Supporter

Languages: English (English ) Italian (Italiano )

Timezone: Europe/Rome (GMT+02:00)

Hello,

can you please also try the 2 solutions shown in this ticket?
- https://wpml.org/forums/topic/browser-based-redirection-is-not-working/#post-1474445

Thank you

April 23, 2019 at 8:47 am #3660897

garryM-2

Hello,

I can confirm that when entering hidden link into the browser it does redirect to hidden link

Also, I can't attempt the solution in the ticket as for some reason there isn't a browser-redirect.js file in the directory (\sitepress-multilingual-cms\res\js\)

April 26, 2019 at 1:26 pm #3690973

Carlos Rojas
Supporter

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

Timezone: America/Montevideo (GMT-03:00)

Hi there,
I'm back from the holidays and I'm taking this ticket back.

I changed the default language of the Mozilla Firefox browser to US English and visited the page hidden link on incognito mode and I got redirected to hidden link as you stated in your previous message.

Could we consider this issue solved or is still happening on your end?

Regards,
Carlos

April 29, 2019 at 9:17 am #3701485

garryM-2

Hi Carlos,

Unfortunately this doesn't solve my original issue of when the browser language is set to US English and visiting the site in UK English it doesn't redirect to US English as expected.

April 29, 2019 at 8:18 pm #3706505

Carlos Rojas
Supporter

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

Timezone: America/Montevideo (GMT-03:00)

Hi,

I'm consulting my colleagues about the original issue. I will keep you updated.

Thank you very much for your patience and understanding!
Best regards,
Carlos