| |
| | |

CodersClub

 Forgot password?
 Register
Search
View: 15181|Reply: 25
Collapse the left

how to set a default language?

[Copy link]
Post time: 2012-02-17 09:07
| Show all posts |Read mode
Editado por jhoxi en 2012-2-18 03:50

how to set a default languaage?
I would put the Spanish language by default , but do not know where to change, as the default language is English .
Anyone know?

 Korea, Republic of

Post time: 2012-02-17 09:26
| Show all posts
Edited by ionobgy at 2012-2-17 10:43

I did it as below.
But I am not sure that it is correct method.
I changed "en" to "kr" at below file.

config/config_global.php:

$_config['output']['language'] = 'kr';

<comment>
I think that default language must be setted to 'kr' by above change.
But default language is setted to "en"  again after logout in case of my website.
Therefore I changed the class file code as below.

source/class/class_core.php:

                if(empty($_config['languages'])) {
                        $_config['languages'] = array(
                                'kr' => array(
                                        'icon' => 'kr.gif',
                                        'name' => '한국어',
                                        'title' => 'Korea',
                                        'dir' => 'ltr',
                                        )
                        );
                }

                //vot: Set default language
                if(empty($_config['output']['language'])) {
                        $_config['output']['language'] = 'kr';
                }

                //vot: Check for default language is valid
                $tmp = $_config['output']['language'];
                if(!isset($this->var['config']['languages'][$tmp])) {
                        // set valid default language
                        // If Korean exists -> set Korean
                        if(isset($_config['languages']['kr'])) {
                                $_config['output']['language'] = 'kr';
                        } else {
                        // If Korean does not exists -> set the FIRST language
                                foreach($_config['languages'] AS $k => $val) {
                                        $_config['output']['language'] = $k;
                                        break;
                                }
                        }
                }


<comment>
kr language file setting is placed first of language setting part in config_global.php)

 Author| Post time: 2012-02-17 09:36
| Show all posts
Heyyyy, thank you very much man!
This method is fine, thanksss
 Author| Post time: 2012-02-17 10:07
| Show all posts
Editado por jhoxi en 2012-2-17 11:11

Error:

failure to install, I followed every step
Eye: The folder must be "es" no "en"

This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

 Korea, Republic of

Post time: 2012-02-17 10:23
| Show all posts
Edited by ionobgy at 2012-2-17 11:28
jhoxi replied at 2012-2-17 11:07
Editado por jhoxi en 2012-2-17 11:11

Error:

I am sorry, I don't know the cause.
Only, I changed the above code after installing by original multiligual ver setting file.

My obgy.or.kr site is changed by that method.
No error in my site.
Please install first by the not modified multilingual file , and then change the code by above method.

 Author| Post time: 2012-02-17 10:25
| Show all posts
What I want is to start the installation with the Spanish language, thanks

 Korea, Republic of

Post time: 2012-02-17 10:31
| Show all posts
jhoxi replied at 2012-2-17 11:25
What I want is to start the installation with the Spanish language, thanks

I understand.
Yes, At install, default language is english.
This issue may be solved by vot.
Sorry. it is beyond my ability.

 Author| Post time: 2012-02-17 10:37
| Show all posts
ionobgy respondió a las 2012-2-17 11:31
I understand.
Yes, At install, default language is english.
This issue may be solved by vot.

Also, thank you very much for your help.
Valery vot hopefully, help me with this problem

 Russia

Post time: 2012-02-17 10:48
| Show all posts
I think it is not good to modify the core code for just set the default language

The only one method is correct - it is to modify the config_global setting "$_config['output']['language']".
If this does not work - it is a bug! And must be fixed!
I will check this...
 Author| Post time: 2012-02-17 10:52
| Show all posts
Editado por jhoxi en 2012-2-17 11:55
vot respondió a las 2012-2-17 11:48
I think it is not good to modify the core code for just set the default language

The only one me ...

???

config_global.php-> is created automatically after installation, is config_global_default.php?

PD: imagge


This post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x
You have to log in before you can reply Login | Register

Points Rules

Archive|Mobile|Dark room|CodersClub

Top.Mail.Ru
Top.Mail.Ru

2024-04-23 21:11 GMT+3 , Processed in 0.092068 sec., 8 queries .

Powered by Discuz! X3.4 Release 20230520

© 2001-2024 Discuz! Team.

MultiLingual version, Rev. 4301, © codersclub.org

Quick Reply To Top Return to the list