public static function setLocale($category, $languageCode, $countryCode = '')
    {
        $category = (int)$category;

        if (is_string($languageCode)) {
            $languageCode = trim($languageCode);
        }

        $availableCategories = [
            LC_ALL,
            LC_COLLATE,
            LC_CTYPE,
            LC_MONETARY,
            LC_NUMERIC,
            LC_TIME,
            LC_MESSAGES,
        ];

        if (empty($languageCode) || !in_array($category, $availableCategories, true)) {
            return false;
        }

        $localeLongForm = self::getLongForm($languageCode, $countryCode);

        return setlocale($category, $localeLongForm);
    }