Quickly Change Your Language 0.1

Misc MOD Downloads for phpBB3 -- Any MOD that does not fit into any other category
Forum rules
Image Please feel free to download any MOD's here, support for each MOD is located it's own thread.

To post your own MOD, please first read the MOD Guidelines

Quickly Change Your Language 0.1

Postby LEW21 » 16 Sep 2007, 07:07

MOD Name: Quickly Change Your Language
MOD Version: 0.1
Author: LEW21
MOD Description: Allows users to quickly change their language by adding ?lang= to the URL.

Works with: phpBB 3.0.RC5

Language: This mod does not use any language variables

Licence: GNU General Public License v2

Screenshots: N/A

Installation Level: Easy
Installation Time: 2 minutes
Format: MODX
Download: from SF.net
phpBB3.PL - User-friendly Polish phpBB 3.0 support
LEW21    
Translator
Translator
 
Posts: 901
Joined: 01 Jun 2006, 03:51
Location: Warsaw, Poland
Gender: Male
phpBB Knowledge: 10




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: Quickly Change Your Language 0.1

Postby jdh » 16 Sep 2007, 11:00

Nice! *is impressed*

Looking great, LEW21. Keep it up. :good:
Iron helmets will not save
Even heroes from the grave.
Good men's blood will drain away
while the wicked win the day.
User avatar
jdh    
STG Support Team
STG Support Team
 
Posts: 1508
Joined: 05 May 2007, 08:04
Location: Wisconsin
Gender: Male
phpBB Knowledge: 7

Re: Quickly Change Your Language 0.1

Postby porfavor » 16 Sep 2007, 11:16

nice one!
But personally I'd prefer a dropdown box or sth. like that to change the language. Looks better. But this one's great and very useful for a lot of people.
Live your life as long as it is possible!
User avatar
porfavor
Translator
Translator
 
Posts: 78
Joined: 02 Jul 2007, 14:18
Location: Germany
Favorite Team: Hertha BSC Berlin
Gender: Male

Re: Quickly Change Your Language 0.1

Postby jdh » 16 Sep 2007, 13:20

porfavor wrote:nice one!
But personally I'd prefer a dropdown box or sth. like that to change the language. Looks better. But this one's great and very useful for a lot of people.

Well, if you want to change it temp., you could add a drop down box to change it.
Iron helmets will not save
Even heroes from the grave.
Good men's blood will drain away
while the wicked win the day.
User avatar
jdh    
STG Support Team
STG Support Team
 
Posts: 1508
Joined: 05 May 2007, 08:04
Location: Wisconsin
Gender: Male
phpBB Knowledge: 7

Re: Quickly Change Your Language 0.1

Postby LEW21 » 16 Sep 2007, 13:39

Dropdown will be in 0.2 :P
phpBB3.PL - User-friendly Polish phpBB 3.0 support
LEW21    
Translator
Translator
 
Posts: 901
Joined: 01 Jun 2006, 03:51
Location: Warsaw, Poland
Gender: Male
phpBB Knowledge: 10

Re: Quickly Change Your Language 0.1

Postby jdh » 16 Sep 2007, 14:32

wonderful! :grin: :P

May I suggest some way for the user (either an ACP module or a 0 or 1 in a config file) to choose if the drop down in permanent or just temporary? or perhaps a checkbox for the user to make it permanent?

Code: Select All
Language: |¯¯¯¯¯¯¯¯¯¯¯¯¯|V     |¯| Permanent?   |Submit|
Iron helmets will not save
Even heroes from the grave.
Good men's blood will drain away
while the wicked win the day.
User avatar
jdh    
STG Support Team
STG Support Team
 
Posts: 1508
Joined: 05 May 2007, 08:04
Location: Wisconsin
Gender: Male
phpBB Knowledge: 7

Re: Quickly Change Your Language 0.1

Postby LEW21 » 17 Sep 2007, 02:37

Hmm... I don't think that temporary change option is needed - after changing the language user still is able to change it to the previous :P And I want this MOD to be as simple as possible, like Last Posts Titles MOD (I can add to it the possibility to change the max. amount of chars in ACP/UCP, but it will make installing it harder)
phpBB3.PL - User-friendly Polish phpBB 3.0 support
LEW21    
Translator
Translator
 
Posts: 901
Joined: 01 Jun 2006, 03:51
Location: Warsaw, Poland
Gender: Male
phpBB Knowledge: 10

Re: Quickly Change Your Language 0.1

Postby jdh » 17 Sep 2007, 05:34

Okay. :) Makes sense. :D
Iron helmets will not save
Even heroes from the grave.
Good men's blood will drain away
while the wicked win the day.
User avatar
jdh    
STG Support Team
STG Support Team
 
Posts: 1508
Joined: 05 May 2007, 08:04
Location: Wisconsin
Gender: Male
phpBB Knowledge: 7

Re: Quickly Change Your Language 0.1

Postby porfavor » 17 Sep 2007, 08:39

jdh wrote:
porfavor wrote:nice one!
But personally I'd prefer a dropdown box or sth. like that to change the language. Looks better. But this one's great and very useful for a lot of people.

Well, if you want to change it temp., you could add a drop down box to change it.



I don't need it for myself. I could do this, you're right. But not everyone is able.

I see this feature will be in a future version
Live your life as long as it is possible!
User avatar
porfavor
Translator
Translator
 
Posts: 78
Joined: 02 Jul 2007, 14:18
Location: Germany
Favorite Team: Hertha BSC Berlin
Gender: Male

Re: Quickly Change Your Language 0.1

Postby Kjell » 03 Oct 2007, 06:02

Hi, I get a error on debug mode when a tray to register a new user.

[[phpBB Debug] PHP Notice: in file /includes/session.php on line 1877: Undefined variable: userdata
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1877: Undefined variable: userdata
[phpBB Debug] PHP Notice: in file /includes/ucp/ucp_register.php on line 40: Undefined variable: user_lang
[phpBB Debug] PHP Notice: in file /includes/ucp/ucp_register.php on line 42: Undefined variable: user_lang

General Error
Language file ./language//common.php couldn't be opened.
-------------------------^^^^ Hmm, /en/ or /sv/

Line 1877 in session.php
Code: Select all
      if ($user->lang_name != $userdata['user_lang'] && $userdata['user_id'] != ANONYMOUS)



More lines in sessions.php
Spoiler:
Code: Select all
      else if (isset($languages[$userdata['user_lang']]))
      {
         return $userdata['user_lang'];
      }
      return basename($config['default_lang']);
   }

   function set_user_lang(&$user)
   {
      global $phpbb_root_path;

      $user->lang_name =  lang_selector::get_session_lang($user->data);
      $user->lang_path = "{$phpbb_root_path}language/{$user->lang_name}/";
//1876
      if ($user->lang_name != $userdata['user_lang'] && $userdata['user_id'] != ANONYMOUS)
      {
         lang_selector::change_user_lang($user->data['user_id'], $user->lang_name);
      }
   }

   function get_session_lang($userdata)
   {
      global $phpbb_root_path, $phpEx;

      $lang = request_var('lang', '', false, true);
      if (empty($lang) || $lang == $userdata['session_lang'])
      {
         return $userdata['session_lang'];
      }

      if (!file_exists("{$phpbb_root_path}language/$lang/common.$phpEx"))
      {
         return $userdata['session_lang'];
      }
Kjelle
My work - My farm - Ware I live - phpBB support Sweden
"The globe is round, think global", My rules: Be teased is okay on a funny way ;)
User avatar
Kjell    
Supporter
Supporter
 
Posts: 490
Joined: 14 Feb 2007, 13:09
Location: Nordic of Sweden
Favorite Team: NHL N-ville,Forsberg
Gender: Male
phpBB Knowledge: 8

Next

Return to Miscellaneous MODs, Hacks and Downloads

Who is online

Users browsing this forum: Bingbot and 5 guests