Fork me on GitHub

Multilanguage Bug?  Bottom

  • I have a problem with my 0.8 installation.
    PN loads all the time the file theme/xxx/lang/deu/global.php, regardless which language is selected.
    To be honest, I don't have the newest SVN (I have somthing near before MS02), maybe this bug is allready fixed? But I diden't find it in NOC. Can someone confirm? Should I create a ticket?

    Marco
  • Marco,

    I can't be 100% sure as not all bugs make it to a bug report - if one of the dev team sees it then they'll fix it directly rather than creating a bug report and then fixing it (time constraints be primary reason...).

    Check if the issue occurs with the latest daily snapshot (not the MS2 download). If the bug still exists then please log it.

    While typing i've thought on one possible cause. There is the option to match the language to your browser settings. Check this setting under Administration -> System -> Settings -> Auto detect language from browser settings. By default this is enabled.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Thanks for your fast answer. I just checked. The feature is disabled, but if I change the default language to eng, then theme/xxx/lang/eng/global.php will be loaded.
    Unfortunatly, updating to newest NB means a few hours efort, I prefere to wait for RC1. If somebody else with actual SVN could do this this, would be very nice... I hope you don't understanding the wrong way, normaly I always test as best I can...
  • I debuged the problem, the fowling code leads to the problem:

    Code

    function pnThemeLangLoad($script = 'global', $theme = null)
    {
        $currentlang = pnSessionGetVar('lang');
        $language = pnConfigGetVar('language');
        if ($theme == null) {
            $theme = pnUserGetTheme();
        }

        // get the theme info
        $themeinfo = pnThemeGetInfo(pnThemeGetIDFromName($theme));

        $_theme  = DataUtil::formatForOS($themeinfo['directory']);
        $_cLang  = DataUtil::formatForOS($currentlang);
        $_lang   = DataUtil::formatForOS($language);
        $_script = DataUtil::formatForOS($script);

        $files = array();
        $files[] = WHERE_IS_PERSO.'themes/' . $_theme. '/lang/' . $_cLang . '/' . $_lang . '.php';
        $files[] = WHERE_IS_PERSO.'themes/' . $_theme. '/lang/' . $_lang . '/' . $_script . '.php';
        $files[] = 'themes/' . $_theme . '/lang/' . $_cLang . '/' . $_script . '.php';
        $files[] = 'themes/' . $_theme . '/lang/' . $_lang . '/' . $_script . '.php';


        Loader::loadOneFile ($files);

        return;
    }

    After execution, $files contains:

    Array ( [0] => themes/snf/lang/fra/deu.php [1] => themes/snf/lang/deu/global.php [2] => themes/snf/lang/fra/global.php [3] => themes/snf/lang/deu/global.php )

    If I comment out the two lines:
    $files[] = WHERE_IS_PERSO.'themes/' . $_theme. '/lang/' . $_lang . '/' . $_script . '.php';
    $files[] = 'themes/' . $_theme . '/lang/' . $_lang . '/' . $_script . '.php';
    then it works.
    BTW, I updated to the newest pnTheme.php and the problem still exitst.
    Hope this is helpfull for the developers.

    Marco
  • Marco,

    The first bug is that the wrong variable is used in the first entry of the files array. The last variable in the line should be $_script not $_lang hence trying to load deu.php not global.php.

    However the fact that the german language file is loading does not look like a bug to me - merely that your session has your preferred language as german not french. This could be either via the auto language detection,via the switch languages block or via the newlang parameter.

    Try adding newlang=fra to a URL or remove your session - this should reset it back to the default of french.

    Note the code that you've posted isn't from the latest file where the use of incorrect variable has been fixed.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • Quote

    Note the code that you've posted isn't from the latest file where the use of incorrect variable has been fixed.

    You'r right. Shit, I was sure I copied the newest version. It seams I made somthing wrong. Now it works with the newest version. Sorry for wasting your time.
  • 0 users

This list is based on users active over the last 60 minutes.