Quick Language Switch

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
User avatar
WWay
Registered User
Posts: 30
Joined: Wed Oct 18, 2006 9:23 am
Location: Russia, Ханты-Мансийск

Quick Language Switch

Post by WWay »

Hi.
Just wanna ask: how to change language for guests, like it maded with styles:

/forum/index.php?style=x

are there some mod to change language by typing

/forum/index.php?lang=xx

LEW21
Registered User
Posts: 128
Joined: Fri Nov 04, 2005 9:27 pm

Re: Quick Language Switch

Post by LEW21 »

OPEN includes/sessions.php

FIND:

Code: Select all

          // We include common language file here to not load it every time a custom language file is included
BEFORE, ADD:

Code: Select all

          $lang = request_var('lang', '', false, true);
        if (file_exists($phpbb_root_path . 'language/' . $lang . "/common.$phpEx"))
        {
            $this->lang_name = $lang;
            $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/';

            $cookie_expire = $this->time_now + (($config['max_autologin_time']) ? 86400 * (int) $config['max_autologin_time'] : 31536000);
            $this->set_cookie('lang', $lang, $cookie_expire);
            unset($cookie_expire);
        }
phpBB3.pl - user-friendly Polish phpBB3 support

User avatar
WWay
Registered User
Posts: 30
Joined: Wed Oct 18, 2006 9:23 am
Location: Russia, Ханты-Мансийск

Re: Quick Language Switch

Post by WWay »

Huge thanks!!
P.S.
How to save language on every page when you surfing the board?

Post Reply