public function generateLanguageMaskFromLanguageIds(array $languageIds, $alwaysAvailable): int
    {
        // make sure alwaysAvailable part of bit mask always results in 1 or 0
        $languageMask = $alwaysAvailable ? 1 : 0;

        foreach ($languageIds as $languageId) {
            $languageMask |= $languageId;
        }

        return $languageMask;
    }