get an array of language codes spoken at this location
968403
function getLanguages(properties) {
  if (!Array.isArray(properties['wof:lang_x_official'])) {
    return [];
  }
  return properties['wof:lang_x_official']
    .filter(l => (typeof l === 'string' && l.length === 3))
    .map(l => l.toLowerCase());
}
300379
def get_lang_dict(self):
        """"""
        r = self.yandex_translate_request("getLangs")
        self.handle_errors(r)

        return r.json()["langs"]
446701
public static String getText(String code, Object[] args, Locale locale) {
        Preconditions.checkState(messageSource != null,
                "If i18n is enabled, please make sure MessageSource is properly set as a member in "
                        + "MessageSupport");
        return messageSource.getMessage(code, args, locale);
    }
593996
public static function get_content_languages()
    {
        $table = Versioned::current_stage() == 'Live' ? 'SiteTree_Live' : 'SiteTree';

        if (class_exists('SQLSelect')) {
            $query = new SQLSelect("Distinct \"Locale\"", "\"$table\"");
        } else {
            // SS 3.1 compat
            $query = new SQLQuery("Distinct \"Locale\"", array("\"$table\""));
        }

        $query = $query->setGroupBy('"Locale"');
        $dbLangs = $query->execute()->column();

        $langlist = array_merge((array)Translatable::default_locale(), (array)$dbLangs);
        $returnMap = array();
        $allCodes = array_merge(
            Config::inst()->get('i18n', 'all_locales'),
            Config::inst()->get('i18n', 'common_locales')
        );
        foreach ($langlist as $langCode) {
            if ($langCode && isset($allCodes[$langCode])) {
                if (is_array($allCodes[$langCode])) {
                    $returnMap[$langCode] = $allCodes[$langCode]['name'];
                } else {
                    $returnMap[$langCode] = $allCodes[$langCode];
                }
            }
        }
        return $returnMap;
    }
942467
public function getAllLangs(): array
    {
        $domainInfo = $this->intuition->getDomainInfo($this->domain);
        $messageFiles = glob($domainInfo['dir'].'/*.json');
        $languages = array_values(array_unique(array_map(
            function ($filename) {
                return basename($filename, '.json');
            },
            $messageFiles
        )));
        $availableLanguages = [];
        foreach ($languages as $lang) {
            $availableLanguages[$lang] = $this->intuition->getLangName($lang);
        }
        ksort($availableLanguages);
        return $availableLanguages;
    }
484956
public static function getLanguages($active = true, $asArray = false)
    {
        if ($active) {
            return self::find()->where(['status' => static::STATUS_ACTIVE])->asArray($asArray)->all();
        } else {
            return self::find()->asArray($asArray)->all();
        }
    }
1176544
private static int[] findCodeFromLocale(ULocale locale) {
        int[] result = getCodesFromLocale(locale);
        if(result != null) {
            return result;
        }
        ULocale likely = ULocale.addLikelySubtags(locale);
        return getCodesFromLocale(likely);
    }
320181
def get_languages(self):
        """"""
        if self._languages_cache is None:
            self._languages_cache = list(self.iter_languages())
        return self._languages_cache
194671
def languages(self, key, value):
    """"""
    languages = self.get('languages', [])

    values = force_list(value.get('a'))
    for value in values:
        for language in RE_LANGUAGE.split(value):
            try:
                name = language.strip().capitalize()
                languages.append(pycountry.languages.get(name=name).alpha_2)
            except KeyError:
                pass

    return languages
1281136
def get_languages(self):
        
        if self._languages:
            return self._languages
        self._languages = cache.get(self.PAGE_LANGUAGES_KEY % (self.pk))
        if self._languages is not None:
            return self._languages

        languages = [c['language'] for
            c in Content.objects.filter(page=self,
            type="slug").values('language')]
        # remove duplicates
        languages = sorted(set(languages))
        cache.set(self.PAGE_LANGUAGES_KEY % (self.pk), languages)
        self._languages = languages
        return languages
1015679
function getLanguageCode(langCode) {
        if (!languageCodes[langCode]) {
            languageCodes[langCode] = langCode.split(/\-|_/).shift();
        }
        return languageCodes[langCode];
    }
1368650
public function getLanguageValues($asArray = null)
    {
        if (!$this->owner->getIsNewRecord() && $this->_languageValues === null) {
            $this->_languageValues = [];

            /* @var ActiveRecord $language */
            foreach ($this->owner->{$this->languageRelation} as $language) {
                $this->_languageValues[] = $language->getAttribute($this->languageValueAttribute);
            }
        }

        if ($asArray === null) {
            $asArray = $this->languageValuesAsArray;
        }

        if ($asArray) {
            return $this->_languageValues === null ? [] : $this->_languageValues;
        } else {
            return $this->_languageValues === null ? '' : implode(', ', $this->_languageValues);
        }
    }
685448
protected function _getLangTranslationArray($iLang = null, $blAdmin = null, $aLangFiles = null)
    {
        startProfile("_getLangTranslationArray");

        $blAdmin = isset($blAdmin) ? $blAdmin : $this->isAdmin();
        $iLang = $this->_getCacheLanguageId($blAdmin, $iLang);
        $sCacheName = $this->_getLangFileCacheName($blAdmin, $iLang, $aLangFiles);

        if (!isset($this->_aLangCache[$sCacheName])) {
            $this->_aLangCache[$sCacheName] = [];
        }
        if (!isset($this->_aLangCache[$sCacheName][$iLang])) {
            // loading main lang files data
            $this->_aLangCache[$sCacheName][$iLang] = $this->_getLanguageFileData($blAdmin, $iLang, $aLangFiles);
        }

        stopProfile("_getLangTranslationArray");

        // if language array exists ..
        return (isset($this->_aLangCache[$sCacheName][$iLang]) ? $this->_aLangCache[$sCacheName][$iLang] : []);
    }
482626
public function getAvailableLanguageCodes()
    {
        $cache = Cache::getTransientCache();
        $cacheId = 'transifex_languagescodes_' . $this->projectSlug;
        $languageCodes = $cache->fetch($cacheId);

        if (empty($languageCodes)) {
            $apiData = $this->getApiResults('project/' . $this->projectSlug . '/languages');
            foreach ($apiData as $languageData) {
                $languageCodes[] = $languageData->language_code;
            }
            $cache->save($cacheId, $languageCodes);
        }
        return $languageCodes;
    }
231877
def get_categories(self, languages=None):
        
        query_parameters = {}
        if languages is not None:
            query_parameters['languages'] = self._serialize.query('languages', languages, 'str')
        response = self._send(http_method='GET',
                              location_id='e0a5a71e-3ac3-43a0-ae7d-0bb5c3046a2a',
                              version='5.1-preview.1',
                              query_parameters=query_parameters)
        return self._deserialize('[str]', self._unwrap_collection(response))
137232
private Map<String, String> getMessagesForLocale() {

        Map<Locale, Map<String, String>> data = getData();
        if (data == null) {
            return Collections.emptyMap();
        }
        List<Locale> available = new ArrayList<Locale>(data.keySet());
        Locale bestMatchingLocale = OpenCms.getLocaleManager().getBestMatchingLocale(
            getLocale(),
            OpenCms.getLocaleManager().getDefaultLocales(),
            available);
        Map<String, String> bundleForLocale = data.get(bestMatchingLocale);
        if (bundleForLocale == null) {
            return Collections.emptyMap();
        } else {
            return Collections.unmodifiableMap(bundleForLocale);
        }
    }
12914
protected function getLocaleChoices()
    {
        $locale = [];

        foreach ($this->languages as $language) {
            $locale[$language['label']] = $language['locale'];
        }

        return $locale;
    }