Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Addon Language Packs / Language.php automatic language adjustments

Language.php automatic language adjustments

Locked

Started by brainiack on 28 Aug 2006, 11:28 AM · Views: 3,097

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
28 Aug 2006, 11:28 AM
#1
brainiack avatar

brainiack

New Zenner

Join Date:
Aug 2006
Posts:
6
Plugin Contributions:
0

Language.php automatic language adjustments

In includes/classes/language.php is the following function:

    function get_browser_language() {
      $this->browser_languages = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);

      for ($i=0, $n=sizeof($this->browser_languages); $i<$n; $i++) {
        reset($this->languages);
        while (list($key, $value) = each($this->languages)) {
          if (eregi('^(' . $value[0] . ')(;q=[0-9]\\.[0-9])?$', $this->browser_languages[$i]) && isset($this->catalog_languages[$key])) {
            $this->language = $this->catalog_languages[$key];
            break 2;
          }

It seems to me there is a check for the languages that are suported by the browser of the visitor. But it does not function as supposed?

I am using Zen Cart 1.2.6 and because i made some deepgoing adjustments to Zencart i can not easily update my Zencart.

Our website is for the Dutch and Belgium market, as the Belgium market is devided in a Vlemisch (Belgium Dutch) and a French language part I want to check which language the visitor is using with his browser. When he is using the French language he will see our French site and when he is Vlemisch/Vlaams he will see the Dutch-Belgium language.

Is there anyone who knows how to do this or to make the above function work?

28 Aug 2006, 11:40 AM
#2
brainiack avatar

brainiack

New Zenner

Join Date:
Aug 2006
Posts:
6
Plugin Contributions:
0

Re: Language.php automatic language adjustments

duh! i spend 4 hours searching this site for my answer and after i posted this message the board brought up http://www.zen-cart.com/forum/showthread.php?t=24807&page=1&pp=10 as a similair message. This explains all i wanted.

Thread can be closed.