diff options
author | Urban Müller | 2007-08-28 16:49:29 +0000 |
---|---|---|
committer | Urban Müller | 2007-08-28 16:49:29 +0000 |
commit | 3f1a528fd4d9539f130e4c00291b4365b406548b (patch) | |
tree | 030de9333935eea68f3e7cd83e250ef9b8cb57a3 /it_text.class | |
parent | 86f606318085f1394a9765f7a1b27ed328f11acb (diff) | |
download | itools-3f1a528fd4d9539f130e4c00291b4365b406548b.tar.gz itools-3f1a528fd4d9539f130e4c00291b4365b406548b.tar.bz2 itools-3f1a528fd4d9539f130e4c00291b4365b406548b.zip |
allow url based lang overrides
Diffstat (limited to 'it_text.class')
-rw-r--r-- | it_text.class | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/it_text.class b/it_text.class index cccd64c..ab378ac 100644 --- a/it_text.class +++ b/it_text.class @@ -86,6 +86,10 @@ function it_text($p = null) if (!$this->languages[$this->defaultlanguage]) $this->defaultlanguage = $this->language_failsafe; + # language override in URL like page.fr.html + if (preg_match('/\.([a-z]{2})\.[^.\/]+$/i',$_SERVER['PHP_SELF'], $match) && $this->languages[$match[1]]) + $this->set_language($match[1], FALSE); # do not set a cookie + # If a cookie is set, use its value as our active language if (isset($_COOKIE[$this->p['cookiename']]) && ($this->languages[$cookie = $_COOKIE[$this->p['cookiename']]])) { |