Default Language For My Store

HI!

I have added a new language exept the english one and i have set this language as default both at the backend and at the frondend side. My store actually is closed since i am working with it, the problem is that when i open the store at my pc it opens in the language i have set as default but when i try to open it in incognito or in another pc the store opens in english. Very soon the store will be online and i want to show it in my default language and the english to be an optional language. What should i do? I would appreciate very much any help, Thanks

Before applying the default language cs-cart is checking the browser language on file

app/functions/fn.init.php

You can comment this checking and go direct to default language but this means to modify core files and on next upgrade you need to fix it again if the file has been changed ;)

to comment please edit file above

#before

function fn_init_language($params, $area = AREA)
{
    $default_language = Registry::get('settings.Appearance.' . fn_get_area_name($area) . '_default_language');
$show_hidden_languages = $area != 'C' ? true : false;
$avail_languages = fn_get_avail_languages($area, $show_hidden_languages);

if (!empty($params['sl']) && !empty($avail_languages[$params['sl']])) {
    fn_define('CART_LANGUAGE', $params['sl']);
} elseif (!fn_get_session_data('cart_language' . $area) && $_lc = fn_get_browser_language($avail_languages)) {
    fn_define('CART_LANGUAGE', $_lc);
} elseif (!fn_get_session_data('cart_language' . $area) && !empty($avail_languages[$default_language])) {
    fn_define('CART_LANGUAGE', $default_language);

} elseif (($_c = fn_get_session_data('cart_language' . $area)) && !empty($avail_languages[$_c])) {
    fn_define('CART_LANGUAGE', $_c);

} else {
    reset($avail_languages);
    fn_define('CART_LANGUAGE', key($avail_languages));
}


#after

function fn_init_language($params, $area = AREA)
{
    $default_language = Registry::get('settings.Appearance.' . fn_get_area_name($area) . '_default_language');
$show_hidden_languages = $area != 'C' ? true : false;
$avail_languages = fn_get_avail_languages($area, $show_hidden_languages);

if (!empty($params['sl']) && !empty($avail_languages[$params['sl']])) {
    fn_define('CART_LANGUAGE', $params['sl']);
/*} elseif (!fn_get_session_data('cart_language' . $area) && $_lc = fn_get_browser_language($avail_languages)) {
    fn_define('CART_LANGUAGE', $_lc);*/
} elseif (!fn_get_session_data('cart_language' . $area) && !empty($avail_languages[$default_language])) {
    fn_define('CART_LANGUAGE', $default_language);

} elseif (($_c = fn_get_session_data('cart_language' . $area)) && !empty($avail_languages[$_c])) {
    fn_define('CART_LANGUAGE', $_c);

} else {
    reset($avail_languages);
    fn_define('CART_LANGUAGE', key($avail_languages));
}

I hope that helps

Keep on smiling,

---
Valentin
part of hungryweb.net

Thank you for your help, but when i try do add the */ as you said when i search for my store i get an error and the page doesn't open at all :(

Try to use:

// elseif (!fn_get_session_data('cart_language' . $area) && $_lc = fn_get_browser_language($avail_languages)) {
//     fn_define('CART_LANGUAGE', $_lc);

Thank you very much, i solved this issue :)