debian-sf-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Debian-sf-users] how to set a default language?


From: BAYLE Christian FTRD/DTL/GRE
Subject: Re: [Debian-sf-users] how to set a default language?
Date: Thu, 11 Jul 2002 12:27:10 +0200

For 2.6 i will do like this:
you will have to add $sys_lang='Korean'
in /etc/sourceforge/local.inc

and just do like  this in pre.php
if (!$sys_lang) {
        $sys_lang="English";
}
if (user_isloggedin()) {
        $res=$LUSER->getData();
                $classname=db_result($res,0,'classname');
        if ($classname) {
                $Language=new BaseLanguage();
                $Language->loadLanguage($classname);
        } else {
                $Language=new BaseLanguage();
                $Language->loadLanguage($sys_lang);
        }
} else {
        //if you aren't logged in, check your browser settings
        //and see if we support that language
        //if we don't support it, just use English as default
        $res = language_code_to_result ($HTTP_ACCEPT_LANGUAGE);
        $classname=db_result($res,0,'classname');
        if (!$classname) {
                $classname=$sys_lang;
        }
        $Language=new BaseLanguage();
        $Language->loadLanguage($classname);
}

Soon-Son Kwon wrote:

>I could set the default language by editing .../www/include/BaseLanuage.class.
>
>The last line:
>---
>return db_query("select * from supported_languages where language_id='1'")
>---
>sets the default language when the user does not have any preference yet.
>
>Changing the language_id number will set the default language....
>
>I think this can be applied to 2.6.x also.
>
>Thanks very much~~
>
>p.s. BTW, could you please let me know when will the next version of
>2.5.x be released? I am eagerly waiting for it...
>I need a toy for this weekend. :-)
>
>
>On Thu, Jun 27, 2002 at 04:48:07PM +0200, Roland Mas wrote:

>
>>Soon-Son Kwon (2002-06-22 10:45:51 +0900) :
>>
>>   
>>
>>>Can anyone please let me know if a user connects to the
>>>sourceforge(before logging in), how can I set a default language for
>>>him?
>>>
>>>For now, English is the default language.  But for me, I would like
>>>to set Korean the default language when he/she first connects to it
>>>because most of my users are Koreans.
>>>
>>>Any ideas? (I am running 2.5.X)
>>>     
>>>
>>Quick and dirty idea: copy BaseLanguage.class to English.class (so
>>that you keep a full English class), then copy Korean.class onto
>>BaseLanguage.class.
>>
>>  Cleaner solution: edit www/include/pre.php line 155 and around.
>>What would be an interesting addition for the package (2.6 only,
>>please) is a nice Debconf question, a configuration variable, and so
>>on.  If you happen to have too much time on your hands :-)
>>
>>Roland.
>>--
>>Roland Mas
>>
>>The cherry blossom / Tumbles from the highest tree / One needs more petrol
>>  -- in Good Omens (Terry Pratchett and Neil Gaiman)
>>
>>_______________________________________________
>>Debian-sf-users mailing list
>>address@hidden
>>http://mail.freesoftware.fsf.org/mailman/listinfo/debian-sf-users
>>   
>>
>

>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]