Webmastersite.net
Register Log In

Automatically detect language
Automatically detect the language of the visitor's browser

Comments on Automatically detect language

milouchouchou
Forum Regular

Usergroup: Customer
Joined: Nov 05, 2006
Location: Borlo Belgique

Total Topics: 27
Total Comments: 121
Automatically detect language
Posted Jul 13, 2013 - 12:40 PM:

Hello Paul

Is it possible to automatically detect the language of the visitor's browser and start all WSN scripts automatically on the language, leaving the visitors a chance to still choose the language they prefer if the proposed does not suit him. If the language of the browser does not exist in the languages โ€‹โ€‹of scripts, then the language is the default, in my case the French.

This would be a huge advantage for visitors to a language other than French, always in my case.

If this is always possible, can you give me the procedure for the payment.

Cordially.
Francis

Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jul 13, 2013 - 9:18 PM:

I can implement this for $65 for the next release, please use www.wsnlinks.com/index.php?...section=payamount&price=65 to pay

Since I have to translate between the language names and the two letter codes that browsers transmit, I'm using the ISO 639-1 country list: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes . If your language files are named with either the native name or the the english name from that list, they should get selected -- note this is not case-sensitive. I'm also using php.net/manual/en/function....ttp-negotiate-language.php -- not that actual built-in function as it doesn't appear to be present on many hosts, but the recreated example in the first comment -- to ensure that the full list of languages supported by the browser is searched with appropriate weighting priority. When there's no match with browser preference, the WSN default language is used. When a registered member has selected a language in their member profile, that language is always used (the registration default value is calculated from their browser language value though). When a guest uses the language selector on the site to set a cookie specifying desired language, that value gets priority too.
milouchouchou
Forum Regular

Usergroup: Customer
Joined: Nov 05, 2006
Location: Borlo Belgique

Total Topics: 27
Total Comments: 121
Posted Jul 14, 2013 - 1:34 AM:

Hello Paul

The payment has been madeโ€‹โ€‹, thank you for agreeing to this addition.

Currently, the name of my language files are:
french, fullenglish, german, nederlands, spanish, as this originally in the script.

If this is file names must be changed, can you let me know and tell me what may be changed in these files (possibly variable) so that everything works perfectly.

Cordially.
Francis

Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jul 14, 2013 - 1:03 PM:

Only the languages/setup/ has fullenglish.lng -- when installed, it renames to languages/English.lng. Make sure yours is named English.lng (or english.lng). And nederlands should be changed to dutch.lng for consistency.

Should work in 8.0.1 now, but needs testing with different languaged browsers.
milouchouchou
Forum Regular

Usergroup: Customer
Joined: Nov 05, 2006
Location: Borlo Belgique

Total Topics: 27
Total Comments: 121
Posted Jul 15, 2013 - 2:15 AM:

All names of language files have been renamed as requested.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jul 15, 2013 - 7:41 PM:

Please upgrade your sites to 8.0.1 or send me access to do so. It ought to happen automatically but either you have that option off or there's not enough traffic for the cron to run or something odd if going on. Or maybe it'll happen in another day, not sure.
milouchouchou
Forum Regular

Usergroup: Customer
Joined: Nov 05, 2006
Location: Borlo Belgique

Total Topics: 27
Total Comments: 121
Posted Jul 15, 2013 - 9:10 PM:

Hello Paul

I just sent you the access codes by email.

Good day.
Francis
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Jul 16, 2013 - 1:45 AM:

Updated and it now shows me English when I'm not logged in, so appears to be working correctly.
milouchouchou
Forum Regular

Usergroup: Customer
Joined: Nov 05, 2006
Location: Borlo Belgique

Total Topics: 27
Total Comments: 121
Posted Jul 17, 2013 - 7:47 AM:

Hello Paul

It works perfectly, thank you for your work.

Cordially.
Francis
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.