im making a website (wordpress multisite) which is supported by 2 languages for users, there 2 methods we will use it one:
-Detect language by Geo IP
-Detect Language by Internet Browser
Which is the best method to use it?
Thanks in Advance!
im making a website (wordpress multisite) which is supported by 2 languages for users, there 2 methods we will use it one:
-Detect language by Geo IP
-Detect Language by Internet Browser
Which is the best method to use it?
Thanks in Advance!
If the user is a registered user, set the language according to his/her preferences
If the user has been on the site before, using language X, use that (store the language option in a cookie).
If the http header Accept-Language
is present, try to make use of it (you obviously don't support all the languages in the world). In PHP you can get a hold of this value through $_SERVER['ACCEPT_LANGUAGE']
.
I have seen people make use of Accept-Charset
as well, trying to narrow it down if the languages specified (in Accept-Language) can't be used, that is kind of a long shot though.
Final option is to use Geo IP to try and figure out where in the world the user might be, and what language is spoken there. This is a tough one though since the official language in a country might not be the one preferably used by the end user.
As long as the user can easily change language and isn't bound to any of the above presets there shouldn't be any problem.
.. and please; try to keep track of what language a user has been using before so that he or she doesn't have to change language every time he/she visits your site.