Different Interface language by URL

2013-02-03
2013-05-28
  • Knut Krüger
    Knut Krüger
    2013-02-03

    Hi to all
    is it possible to switch the language by URL without logging in?

    if not it would be a feature request

     
  • Knut Krüger
    Knut Krüger
    2013-02-04

    Its useful to set the language from outside refbase if refbase is integrated f.e with iframe in an other page with different language support.

    I added in index.php after:

        // START A SESSION:
        // call the 'start_session()' function (from 'include.inc.php') which will also read out available session variables:
        start_session(true);
    
        // --------------------------------------------------------------------
        // Set language by command line and cookie
        // f.e paramenter index.php?lang=de  possbile languages see inc.inc.php
            parse_str ( $_SERVER['QUERY_STRING'] );
            if (isset($lang))
                setcookie("refbase_language",$lang, time()+60*60*24*6004);
        // --------------------------------------------------------------------
    

    and in  ini.inc.php instead

      $defaultLanguage = "en"; // possible values: "en", "de", "fr", or "cn"
    
    // The default interface language:
    // cookie could be set in index.php by url paramenter
    if (!isset($_COOKIE["refbase_language"]) or $_COOKIE["refbase_language"]== "")
      $defaultLanguage = "en"; // possible values: "en", "de", "fr", or "cn"
    else
      $defaultLanguage = $_COOKIE["refbase_language"]; // possible values: "en", "de", "fr", or "cn"
    

    Thats`s all