S
S
SvetlanaKasjanova2019-05-29 16:09:02
1C-Bitrix
SvetlanaKasjanova, 2019-05-29 16:09:02

How to automatically detect the portal language?

How to set up to automatically determine the required language of the site for the user?
There is a portal with the ability to switch to both Russian and English manually.
Portal in the .com zone
For example, an English user in the UK opens a portal. The portal at the entrance opens in Russian. Yes, he can manually switch to English - there is such an opportunity.
But how to set it up so that this Englishman has the opportunity to immediately open a portal in English?
Where are the settings made - on the browser side? Maybe a plugin is needed?
Or is it to finish with the code on the side of Bitrix24?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
2
2cha.headz, 2019-05-30
@glagolew059

You can use js to determine the default language of the browser

var userLang = navigator.language || navigator.userLanguage; 
console.log(userLang);

and either redirect to the English version, or simulate, through js, clicking on the English button. language per user =)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question