renders a list of available languages
542584
public function languages($config = array())
    {
          $config = new AnConfig($config);
          $path = ANPATH_SITE.DS.'language';
          $languages = preg_grep('/^([^.])/', scandir($path));
          $options = array();

          foreach($languages as $language){
              $manifest = json_decode(file_get_contents($path.DS.$language.DS.$language.'.json'));
              $options[] = array(
                'name' => $manifest->name,
                'value' => $language
              );
          }

          $config->options = $options;

          return $this->formfield_select($config);
    }
1269587
public function index()
    {
        $this->loadModel('Locale.Languages');
        $languages = $this->Languages
            ->find()
            ->order(['ordering' => 'ASC'])
            ->all();

        $this->title(__d('locale', 'Languages List'));
        $this->set('languages', $languages);
        $this->Breadcrumb->push('/admin/locale');
    }
791626
def multilingual(request):
    
    codes = sorted(get_language_code_list())
    return {'LANGUAGE_CODES': codes,
            'LANGUAGE_CODES_AND_NAMES': [(c, LANG_DICT.get(c, c)) for c in codes], 
            'DEFAULT_LANGUAGE_CODE': get_default_language_code(),
            'ADMIN_MEDIA_URL': settings.ADMIN_MEDIA_PREFIX}
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
77533
def supported_languages(self, task=None):
    
    if task:
      collection = self.get_collection(task=task)
      return [isoLangs[x.id.split('.')[1]]["name"]
                                         for x in collection.packages]
    else:
      return [x.name.split()[0] for x in self.collections()
                                         if Downloader.LANG_PREFIX in x.id]
1287124
public function listLanguage()
    {
        $this->refreshLanguage();
        $this->setTitleListLanguage();
        $this->setBreadcrumbListLanguage();
        $this->setFilterListLanguage();
        $this->setPagerListLanguage();

        $this->setData('languages', (array) $this->getListLanguage());
        $this->outputListLanguage();
    }
216952
def language_select(method, options = {}, html_options = {}, additional_language = nil)
      @languages ||= (additional_language ? [additional_language] : []) + Language.find(:all, :order => 'name asc')
      self.menu_select(method, I18n.t('muck.engine.choose_language'), @languages, options.merge(:prompt => I18n.t('muck.engine.select_language_prompt'), :wrapper_id => 'languages-container'), html_options.merge(:id => 'languages'))
    end
266440
def render_unicode(self, *args, **data):
        """"""

        return runtime._render(self,
                                self.callable_,
                                args,
                                data,
                                as_unicode=True)
1100669
def listing_for_language(language)
      ensure_active_edit!

      begin
        result = client.get_listing(
          current_package_name,
          current_edit.id,
          language
        )

        return Listing.new(self, language, result)
      rescue Google::Apis::ClientError => e
        return Listing.new(self, language) if e.status_code == 404 # create a new empty listing
        raise
      end
    end
1297294
def get_available_languages(self, obj):
        
        if obj:
            return obj.get_available_languages()
        else:
            return self.model._parler_meta.root_model.objects.none()
951842
async def render(
        text: TransText,
        request: Optional['Request'],
        multi_line=False) -> Union[Text, List[Text]]:
    

    if isinstance(text, str):
        out = [text]
    elif isinstance(text, StringToTranslate):
        out = await text.render_list(request)
    else:
        raise TypeError('Provided text cannot be rendered')

    if multi_line:
        return out
    else:
        return ' '.join(out)
222240
def sanitize_available_locales(available_languages)
      available_languages.map do |available|
        available.to_s.split(/[_-]/).reject { |part| part.start_with?("x") }.join("-")
      end
    end
693100
async function renderList(nj, templList, templateVars) {
  const renderedList = await Promise.map(
    _.without(templList, _.isUndefined),
    async(it) => render(nj, it, templateVars));
  return renderedList;
}
806309
def get_available_languages(self, obj, formset):
        
        if obj:
            # Inlines dictate language code, not the parent model.
            # Hence, not looking at obj.get_available_languages(), but see what languages
            # are used by the inline objects that point to it.
            filter = {
                'master__{0}'.format(formset.fk.name): obj
            }
            return self.model._parler_meta.root_model.objects.using(obj._state.db).filter(**filter) \
                   .values_list('language_code', flat=True).distinct().order_by('language_code')
        else:
            return self.model._parler_meta.root_model.objects.none()
557151
def view_all(request, language, filter=None):
	

	# Is there any filter?
	if request.method == "POST":
		data = request.POST.dict()

		if not data["search"] or data["search"]=="":
			return HttpResponseRedirect(reverse("modeltranslation:view_all_url",args=(data["language"],data["filter"])))

		return HttpResponseRedirect(reverse("modeltranslation:view_all_url",args=(data["language"],data["filter"]))+"?search="+data["search"])

	LANGUAGES = dict(lang for lang in settings.LANGUAGES)
	if language not in LANGUAGES.keys():
		raise Http404(u"Language {0} does not exist".format(language))
	
	if language == settings.LANGUAGE_CODE:
		raise Http404(u"El idioma {0} es el idioma por defecto".format(language))

	# Translation filter
	trans_filter = {"lang":language}
	if filter == "all" or filter is None:
		pass
	elif filter == "fuzzy":
		trans_filter["is_fuzzy"] = True
	elif filter == "completed":
		trans_filter["is_fuzzy"] = False
	
	search_query = ""
	if request.GET and "search" in request.GET and request.GET.get("search")!="":
		search_query = request.GET.get("search")
		trans_filter["source_text__icontains"] = search_query

	translations = FieldTranslation.objects.filter(**trans_filter)
	
	# Update translations
	active_translations = []
	for translation in translations:
		source_model = translation.get_source_model()
		if not translation.field in source_model._meta.translatable_fields:
			translation.delete()
		else:
			active_translations.append(translation)
	
	replacements = {"translations":active_translations, "filter":filter, "lang":language, "language":LANGUAGES[language], "search_query":search_query}
	return render_to_response('modeltranslation/admin/list.html',replacements, RequestContext(request))
1069368
def poll_open_file_languages(self):
        """"""
        languages = []
        for index in range(self.get_stack_count()):
            languages.append(
                self.tabs.widget(index).language.lower())
        return set(languages)
1095184
def language_code_select(priority_languages, options, html_options)
      selected = object.send(@method_name) if object.respond_to?(@method_name)

      languages = ""

      if options.present? and options[:include_blank]
        option = options[:include_blank] == true ? "" : options[:include_blank]
        languages += "<option>#{option}</option>\n"
      end

      if priority_languages
        languages += options_for_select(priority_languages, selected)
        languages += "<option value=\"\" disabled=\"disabled\">-------------</option>\n"
      end

      languages = languages + options_for_select(language_translations, selected)

      html_options = html_options.stringify_keys
      add_default_name_and_id(html_options)

      content_tag(:select, languages.html_safe, html_options)
    end