From 3f1a528fd4d9539f130e4c00291b4365b406548b Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 28 Aug 2007 16:49:29 +0000 Subject: allow url based lang overrides --- it_text.class | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'it_text.class') 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']]])) { -- cgit v1.2.3