Changing the default language

Currently the default language for Family Connections is hard coded to 'English'. This can be changed relatively easily, but requires altering some of the source code.

Open up the fcms.php in your favorite text editor and change the return value on the getLanguage function (around line 270).

function getLanguage ()
{
    global $fcmsDatabase, $fcmsError;
    if (isset($_SESSION['fcms_id']))
    {
        $id = (int)$_SESSION['fcms_id'];
        $sql = "SELECT `language` 
                FROM `fcms_user_settings` 
                WHERE `id` = ?";
        $row = $fcmsDatabase->getRow($sql, $id);
        if ($row === false)
        {
            $this->fcmsError->displayError();
            return;
        }
        if (count($row) > 0)
        {
            return $row['language'];
        }
    }
    return 'en_US';
}

This return value is based on the ISO-639 language code (e.g. pt for Portuguese) followed by the ISO-3166 country code (e.g. _PT for Portugal or _BR for Brazil).


This article is for versions 2.5 and newer.

Recent Discussions

05 Oct, 2020 12:05 PM
05 Oct, 2020 11:56 AM
09 Aug, 2020 07:49 PM
02 Aug, 2020 04:59 AM
25 Jul, 2020 03:29 PM