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

07 Dec, 2018 09:37 PM
07 Dec, 2018 04:55 PM
26 Nov, 2018 05:38 PM
26 Nov, 2018 05:37 PM
26 Nov, 2018 03:44 PM