Returns the language pairs available on unbabel
435934
def get_language_pairs(self, train_langs=None):
        '''
            
        '''
        if train_langs is None:
            result = self.api_call('language_pair/')
        else:
            result = self.api_call(
                'language_pair/?train_langs={}'.format(train_langs))
        try:
            langs_json = json.loads(result.content)
            if 'error' in langs_json:
                return []
            languages = [LangPair(Language(
                shortname=lang_json["lang_pair"]["source_language"][
                    "shortname"],
                name=lang_json["lang_pair"]["source_language"]["name"]),
                Language(shortname=lang_json["lang_pair"][
                    "target_language"]["shortname"],
                         name=lang_json["lang_pair"][
                             "target_language"]["name"])
            ) for lang_json in langs_json["objects"]]
        except Exception, e:
            log.exception("Error decoding get language pairs")
            raise e
        return languages
1164508
function getLanguages(options) {
  options.hash = _private.getDevHash(options.secret);
  return _private.makeRequest(_getLink(options), 'Unable to fetch project languages');
}
1317056
def get_languages(self):
        
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/languages"
        )
        return data
533898
public function getSupportedLanguages()
    {
        return array(
            self::LANG_SR,
            self::LANG_RU,
            self::LANG_BE,
            self::LANG_MK,
            self::LANG_UK,
            self::LANG_BG,
            self::LANG_EL
        );
    }
751898
public List<String> getBodyLanguages() {
        Body defaultBody = getMessageBody(null);
        List<String> languages = new ArrayList<String>();
        for (Body body : getBodies()) {
            if (!body.equals(defaultBody)) {
                languages.add(body.language);
            }
        }
        return Collections.unmodifiableList(languages);
    }
954156
def get_language_tabs(self):
        
        current_language = self.get_current_language()
        if self.object:
            available_languages = list(self.object.get_available_languages())
        else:
            available_languages = []

        return get_language_tabs(self.request, current_language, available_languages)
979154
static function availableLanguages()
    {
        $langs = array();
        $lang_dir = ReporticoUtility::findBestLocationInIncludePath("language");
    //echo $lang_dir; die;
        if (is_dir($lang_dir)) {
            // Place english at the start
            if ($dh = opendir($lang_dir)) {
                while (($file = readdir($dh)) !== false) {
                    if ($file == "en_gb" || $file == "en_us") {
                        if (is_dir($lang_dir . "/" . $file)) {
                            $langs[] = array("label" => self::templateXlate($file), "value" => $file, "active" => ($file == ReporticoApp::getConfig("language")));
                        }
                    }

                }
                closedir($dh);
            }
            if ($dh = opendir($lang_dir)) {
                while (($file = readdir($dh)) !== false) {
                    if ($file != "." && $file != ".." && $file != "CVS" && $file != "packs" && $file != "en_us" && $file != "en_gb") {
                        if (is_dir($lang_dir . "/" . $file)) {
                            $langs[] = array("label" => self::templateXlate($file), "value" => $file, "active" => ($file == ReporticoApp::getConfig("language")));
                        }
                    }

                }
                closedir($dh);
            }
        }

        // No languages found at all - default to en_gb
        if (count($langs) == 0) {
            $langs[] = array("label" => self::templateXlate("en_gb"), "value" => "en_gb");
        }
        return $langs;
    }
75131
def available_locales
      cached_locales = cache.keys.map { |key| key.split('.').first }
      (cached_locales + super).uniq.map { |locale| locale.to_sym }
    end
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());
}
447934
def lang_match_rdf(triple, accepted_languages):
    ''''''
    if not accepted_languages:
        return True
    languages = set([n.language for n in triple if isinstance(n, Literal)])
    return (not languages) or (languages & accepted_languages)
413661
def supported_languages(self):
        
        if self.__supported_languages is None:
            res = self.wiki_request({"meta": "siteinfo", "siprop": "languages"})
            tmp = res["query"]["languages"]
            supported = {lang["code"]: lang["*"] for lang in tmp}
            self.__supported_languages = supported
        return self.__supported_languages
154415
def language_support(f, attribute, options)
      return if Fae.languages.blank?

      attribute_array = attribute.to_s.split('_')
      language_suffix = attribute_array.pop
      return unless Fae.languages.has_key?(language_suffix.to_sym) || Fae.languages.has_key?(language_suffix)

      label = attribute_array.push("(#{language_suffix})").join(' ').titleize
      options[:label] = label unless options[:label].present?

      if options[:wrapper_html].present?
        options[:wrapper_html].deep_merge!({ data: { language: language_suffix } })
      else
        options[:wrapper_html] = { data: { language: language_suffix } }
      end
    end
181505
def get_languages_from_model(app_label, model_label):
        
        try:
            mod_lan = TransModelLanguage.objects.filter(model='{} - {}'.format(app_label, model_label)).get()
            languages = [lang.code for lang in mod_lan.languages.all()]
            return languages
        except TransModelLanguage.DoesNotExist:
            return []
95000
def languages_column(self, obj):
        
        languages = self.get_available_languages(obj)
        return '<span class="available-languages">{0}</span>'.format(
            " ".join(languages)
        )
51946
def available_languages(self):
        
        available_languages = getattr(self, '_available_languages', None)
        if available_languages:
            return available_languages
        try:
            languages = os.listdir(self.data_directory)
        except OSError:
            raise StopWordError(
                "'datas' directory is unreadable, check your installation.")
        languages = sorted(map(lambda x: x.replace('.txt', ''), languages))
        setattr(self, '_available_languages', languages)
        return languages
1224306
def i18n_get_supported_locales():
    
    locale_path = i18n_get_path()
    log.debug('Scanning translation files .mo in locale path: {}'.format(locale_path))
    langs = []
    mo_file = '{project}.mo'.format(project=project.PROJECT_TITLE.lower())
    for lc in locale_path.iterdir():
        lc_mo_path = lc / 'LC_MESSAGES' / mo_file
        if lc_mo_path.exists():
            langs.append(lc.name)
    log.debug('Detected: {langs}'.format(langs=langs))
    return langs
155430
def get_lang_array(self):
        """"""

        r = self.yandex_translate_request("getLangs", "")
        self.handle_errors(r)

        return r.json()["dirs"]