How best to do language detection user?

0 like 0 dislike
Pliz tell me what is the most optimal way possible to determine what language to display the site.

Want to check in index.php and in the body of the page to display the JS variable

var language = 'EN';

Then in the script to initialize

var lang; var languages = { 'EN':{ 'qq':'Hello', 'fav':'Favorites', 'all':'All' }, 'en':{ 'qq':'Hello', 'fav':'favorites', 'all':'All' }, init : function(){ lang = this[language]; } }; languages.init();
by | 3 views

1 Answer

0 like 0 dislike
On Habre was the theme.

When you select a language manually – written in cookies. On every request to see the cookies and if not, then determine based on the headers.

Related questions

110,608 questions
257,186 answers
33,912 users