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

14 Aug, 2018 07:53 PM
11 Aug, 2018 12:39 PM
05 Aug, 2018 01:43 AM
09 Jul, 2018 01:15 PM
03 Jul, 2018 08:51 AM