How best to do language detection user?

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
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 | 10 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,187 answers
40,796 users