Language Loginscreen



  • Hello,

    maybe there is a bug in the webapp.
    The login screen is stil in English.

    My system Debian 9 (Stretch)
    Last Kopano community version
    Webapp 3.4.21.1699 + 964-Debian_9.0-all

    /etc/default/locale

    LANG="de_DE.UTF-8"
    

    locale:

    LANG=de_DE.UTF-8
    LANGUAGE=
    LC_CTYPE="de_DE.UTF-8"
    LC_NUMERIC="de_DE.UTF-8"
    LC_TIME="de_DE.UTF-8"
    LC_COLLATE="de_DE.UTF-8"
    LC_MONETARY="de_DE.UTF-8"
    LC_MESSAGES="de_DE.UTF-8"
    LC_PAPER="de_DE.UTF-8"
    LC_NAME="de_DE.UTF-8"
    LC_ADDRESS="de_DE.UTF-8"
    LC_TELEPHONE="de_DE.UTF-8"
    LC_MEASUREMENT="de_DE.UTF-8"
    LC_IDENTIFICATION="de_DE.UTF-8"
    LC_ALL=
    

    /etc/apache2/envvars

    . /etc/default/locale
    export LANG
    

    PHP test:

    var_dump($_SERVER);
    
     ["LANG"]=>
      string(11) "de_DE.UTF-8"
    

    /etc/default/kopano:

    KOPANO_LOCALE="de_DE.utf8"                                                                                                        
    KOPANO_USERSCRIPT_LOCALE="de_DE.utf8" 
    

    I testet set manualy in webapp config.php

    $_ENV["LANG"] = "de_DE";          
    

    Is there a posibility to check if $_ENV[“LANG”] corectly set?

    Greets
    Thomas



  • As with any website, I expect it to honor the language preference list as sent by the browser (“Accept-Language:”), not any system setting.



  • Hi,

    yes, but german is the first language set in browser preference.



  • hi tommi,
    I thought to have the same issue. After Upgrading to 3.4.20.1690+74.1 my welcome screen suddenly was english.
    But after restarting Kopano-server - now its german again.
    Have you tried a simple restart?



  • Hi,

    yes I restarted Kopano and apache.


  • Kopano



  • Hi marty,

    yes I know but I like to figure out why webapp behave like this. maybe i have overseen something or there is really a bug.
    It is not so annoying because after login the language is correct.



  • Hi tommi,

    I have the same problem for a long time already
    it concerns checks the initialization of the language before the login, after the login it’s ok.
    The error in apache log give this out

    Unknown language: ‘de_DE’, referer: https://xxx.xxx/webapp/

    no matter what I adjust in the config.php it always comes the same error (en_GB etc …)
    this is a mistake but apparently does not demand so much attention;)

    thanks


  • Kopano

    @Sinux

    I think it’s a bug in WebApp. I see a difference in the cookie and the language set by the admin.

    On a test server could you change the line above
    https://stash.kopano.io/projects/KW/repos/kopano-webapp/browse/index.php#87

    and add
    $lang = $Language->resolveLanguage($lang);

    It should then look like

    // Get language from the cookie, or from the language that is set by the admin
                    $Language = new Language();
                    $lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : LANG;
                    $lang = $Language->resolveLanguage($lang);
                    $Language->setLanguage($lang);
    

    Let me know if this works



  • thanks @marty

    I made this adjustment in the webapp config.php

    <------>// Location to the translations
    <------>define(“LANGUAGE_DIR”, “server/language/”);

    <------>// Defines the default interface language. This can be overridden by the user.
    <------>if (isset($_ENV[‘LANG’]) && $_ENV[‘LANG’]!=“C”){
    <------><------>define(‘LANG’, $_ENV[“LANG”]); // This means the server environment language determines the web client language.
    <------>}else{
    <------><------>define(‘LANG’, ‘de_DE’); // default fallback language
    <------>}
    and your entry in the index.php and it works now finally (after all the years;) thank you very much!!!
    Can I safely set this up in my productive environment?

    thanks!!!


  • Kopano

    Hi @Sinux ,

    I commited the index.php fix in webapp master (https://stash.kopano.io/projects/KW/repos/kopano-webapp/commits/6e8dcb5ecd5db270615dc2d6ae4c57158c7ddfa4)

    It will end up in the 3.5.3 release.



  • good news, thanks man ;)


Log in to reply