Populate the languageSelect DropdownButton's menu with all registered Languages
966918
function _populateLanguageDropdown() {
        // Get all non-binary languages
        var languages = _.values(LanguageManager.getLanguages()).filter(function (language) {
            return !language.isBinary();
        });

        // sort dropdown alphabetically
        languages.sort(function (a, b) {
            return a.getName().toLowerCase().localeCompare(b.getName().toLowerCase());
        });

        languageSelect.items = languages;

        // Add option to top of menu for persisting the override
        languageSelect.items.unshift("---");
        languageSelect.items.unshift(LANGUAGE_SET_AS_DEFAULT);
    }
338147
private void iniLanguage(CmsUserSettings settings) {

        m_language.setContainerDataSource(CmsVaadinUtils.getLanguageContainer("caption"));
        m_language.setItemCaptionPropertyId("caption");
        m_language.setNewItemsAllowed(false);
        m_language.setNullSelectionAllowed(false);
        if (settings != null) {
            m_language.select(settings.getLocale());
        } else {
            m_language.select(m_language.getItemIds().iterator().next());
        }
    }
1329391
protected function initLanguages()
    {
        $this->languageIdList[0] = 0;

        $query      = 'SELECT uid
                         FROM sys_language
                        WHERE hidden = 0';
        $langIdList = DatabaseUtility::getColWithIndex($query);

        $this->languageIdList = $langIdList;
    }
583023
def sub_menu(request, page_id):
    """"""
    page = Page.objects.get(id=page_id)
    pages = page.children.all()
    page_languages = settings.PAGE_LANGUAGES
    return render_to_response("admin/basic_cms/page/sub_menu.html", {
        'page': page,
        'pages': pages,
        'page_languages': page_languages,
    }, context_instance=RequestContext(request))
1011480
public function createDropdownLangMenu(
        \Knp\Menu\ItemInterface &$menu,
        array $languages,
        $currentLanguage,
        $route = 'networking_init_change_language'
    ) {
        $dropdown = $menu->addChild(
            $this->translator->trans('Change Language'),
            ['dropdown' => true, 'icon' => 'caret']
        );

        foreach ($languages as $language) {
            $node = $dropdown->addChild(
                $language['label'],
                ['uri' => $this->router->generate($route, ['oldLocale' => $this->request->getLocale(), 'locale' => $language['locale']])]
            );

            if ($language['locale'] == $currentLanguage) {
                $node->setCurrent(true);
            }
            $node->setExtra('translation_domain', false);
        }
    }
977286
private function fillKey()
    {
        $languages = $this->manager->languages();

        if ($this->languageKey) {
            if (! in_array($this->languageKey, $languages)) {
                $this->error(sprintf('Language (%s) could not be found!', $this->languageKey));

                return;
            }

            // If a language key was specified then we prompt for it only.
            $languages = [$this->languageKey];
        }

        $values = $this->collectValues($languages);

        $this->manager->fillKeys(
            str_replace($this->packageName.'::', '', $this->fileName),
            [$this->key => $values]
        );

        foreach ($values as $languageKey => $value) {
            $this->line("<fg=yellow>{$this->fileName}.{$this->key}:{$languageKey}</> was set to \"<fg=yellow>{$value}</>\" successfully.");
        }
    }
445687
public static function language()
	{
		// Create the batch selector to change the language on a selection list.
		$lines = array(
			'<label id="batch-language-lbl" for="batch-language" class="hasTip" title="' . Lang::txt('JLIB_HTML_BATCH_LANGUAGE_LABEL') . '::' . Lang::txt('JLIB_HTML_BATCH_LANGUAGE_LABEL_DESC') . '">',
			Lang::txt('JLIB_HTML_BATCH_LANGUAGE_LABEL'),
			'</label>',
			'<select name="batch[language_id]" class="inputbox" id="batch-language-id">',
			'<option value="">' . Lang::txt('JLIB_HTML_BATCH_LANGUAGE_NOCHANGE') . '</option>',
			Select::options(ContentLanguage::existing(true, true), 'value', 'text'),
			'</select>'
		);

		return implode("\n", $lines);
	}
292613
def _get_default_language(self):
        

        assert hasattr(self, 'available_languages'), \
            'No available languages have been generated.'
        assert len(self.available_languages) > 0, \
            'No available languages to select from.'

        if (
            settings.DEFAULT_LANGUAGE and
            settings.DEFAULT_LANGUAGE in self.available_languages
        ) or (
            'language_code' not in self.form.base_fields
        ):
            # Default language still available

            self.available_languages.remove(settings.DEFAULT_LANGUAGE)
            return settings.DEFAULT_LANGUAGE

        else:
            # Select the first item and return it
            return self.available_languages.pop(0)
1257951
public static SelectOptions getOptionsForLanguageStatic(Locale setLocale, Locale prevLocale) {

        // get available locales from the workplace manager
        List<Locale> locales = OpenCms.getWorkplaceManager().getLocales();
        List<String> options = new ArrayList<String>(locales.size());
        List<String> values = new ArrayList<String>(locales.size());
        int checkedIndex = 0;
        int counter = 0;
        Iterator<Locale> i = locales.iterator();
        while (i.hasNext()) {
            Locale currentLocale = i.next();
            // add all locales to the select box
            String language = currentLocale.getDisplayLanguage(setLocale);
            if (CmsStringUtil.isNotEmpty(currentLocale.getCountry())) {
                language = language + " (" + currentLocale.getDisplayCountry(setLocale) + ")";
            }
            if (CmsStringUtil.isNotEmpty(currentLocale.getVariant())) {
                language = language + " (" + currentLocale.getDisplayVariant(setLocale) + ")";
            }
            options.add(language);
            values.add(currentLocale.toString());
            if (prevLocale.toString().equals(currentLocale.toString())) {
                // mark the currently active locale
                checkedIndex = counter;
            }
            counter++;
        }
        SelectOptions selectOptions = new SelectOptions(options, values, checkedIndex);
        return selectOptions;
    }
1128157
private void buildUI() {

		// Attribute select:
		attributeSelect = new SelectItem("attributeItem");
		attributeSelect.setWidth(140);
		attributeSelect.setShowTitle(false);
		attributeSelect.setValueMap(getSearchableAttributes(layer));
		attributeSelect.setHint(I18nProvider.getSearch().gridChooseAttribute());
		attributeSelect.setShowHintInField(true);

		attributeSelect.setValidateOnChange(true);
		attributeSelect.setShowErrorStyle(true);
		attributeSelect.setRequired(true);

		// Operator select:
		operatorSelect = new SelectItem("operatorItem");
		operatorSelect.setDisabled(true);
		operatorSelect.setWidth(140);
		operatorSelect.setShowTitle(false);

		operatorSelect.setValidateOnChange(true);
		operatorSelect.setShowErrorStyle(true);
		operatorSelect.setRequired(true);

		// Value form item:
		valueItem = new AttributeFormItem("valueItem");
		valueItem.setShowTitle(false);
		valueItem.setDisabled(true);
		valueItem.setWidth(150);

		// Mechanisms:
		attributeSelect.addChangedHandler(new ChangedHandler() {

			public void onChanged(ChangedEvent event) {
				selectedAttribute = getSelectedAttribute();
				if (selectedAttribute != null) {
					// Adjust operator value map and enabled:
					operatorSelect.setDisabled(false);
					String[] operators = getOperatorsForAttributeType(selectedAttribute);
					operatorSelect.setValueMap(operators);
					operatorSelect.setValue(operators[0]);

					// Adjust value form item and enable:
					valueItem.setAttributeInfo(selectedAttribute);
					valueItem.setDisabled(false);
					valueItem.setWidth(form.getWidth() - 290);
				}
			}
		});

		// Finalize:
		form = new DynamicForm();
		form.setNumCols(6);
		form.setHeight(26);
		form.setWidth100();
		form.setFields(attributeSelect, operatorSelect, valueItem);
		addChild(form);
	}
494133
protected function createLanguageList($selected = null, $basePath = JPATH_ROOT)
	{
		$list = array();

		$langHelper = new LanguageHelper;
		$langs      = $langHelper->getKnownLanguages($basePath);

		foreach ($langs as $lang => $metadata)
		{
			$option = array();

			$option['text'] = $metadata['name'];
			$option['value'] = $lang;

			if ($selected && $lang == $selected)
			{
				$option['selected'] = 'selected="selected"';
			}

			$list[] = (object) $option;
		}

		return $list;
	}
630682
public function getLanguages()
    {
        if ($this->_languages === null) {
            $this->_languages = (new DbQuery())->select(['short_code', 'id'])->indexBy('short_code')->from('admin_lang')->all();
        }

        return $this->_languages;
    }
1042011
private void setRequestLanguages(WbGetEntitiesActionData properties) {
		if (this.filter.excludeAllLanguages()
				|| this.filter.getLanguageFilter() == null) {
			return;
		}
		properties.languages = ApiConnection.implodeObjects(this.filter
				.getLanguageFilter());
	}
974492
def choose_language(self, lang, request):
        """"""

        # Can be an empty string or None
        if not lang:
            lang = get_language_from_request(request)

        # Raise a 404 if the language is not in not in the list
        if lang not in [key for (key, value) in settings.PAGE_LANGUAGES]:
            raise Http404

        # We're going to serve CMS pages in language lang;
        # make django gettext use that language too
        if lang and translation.check_for_language(lang):
            translation.activate(lang)

        return lang
867346
function init()
	{
		global $wp_locale;
		
		$this->l10n = array(
			'closeText'         => __( 'Done', 'acf' ),
	        'currentText'       => __( 'Today', 'acf' ),
	        'monthNames'        => array_values( $wp_locale->month ),
	        'monthNamesShort'   => array_values( $wp_locale->month_abbrev ),
	        'monthStatus'       => __( 'Show a different month', 'acf' ),
	        'dayNames'          => array_values( $wp_locale->weekday ),
	        'dayNamesShort'     => array_values( $wp_locale->weekday_abbrev ),
	        'dayNamesMin'       => array_values( $wp_locale->weekday_initial ),
	        'isRTL'             => isset($wp_locale->is_rtl) ? $wp_locale->is_rtl : false,
		);
	}
115390
protected function addLanguage()
    {
        $this->controlAccess('language_add');

        if ($this->language->add($this->getSubmitted())) {
            $this->redirect('admin/settings/language', $this->text('Language has been added'), 'success');
        }

        $this->redirect('', $this->text('Language has not been added'), 'warning');
    }
1132052
protected void initBodyElementLanguage() {

        List<Locale> locales = m_page.getLocales();
        Locale defaultLocale = OpenCms.getLocaleManager().getDefaultLocales(getCms(), getCms().getSitePath(m_file)).get(
            0);

        if (locales.size() == 0) {
            // no body present, create default body
            if (!m_page.hasValue(CmsDefaultPageEditor.XML_BODY_ELEMENT, defaultLocale)) {
                m_page.addValue(CmsDefaultPageEditor.XML_BODY_ELEMENT, defaultLocale);
            }
            try {
                m_file.setContents(m_page.marshal());
                getCms().writeFile(m_file);
            } catch (CmsException e) {
                // show error page
                try {
                    showErrorPage(this, e);
                } catch (JspException exc) {
                    // should usually never happen
                    if (LOG.isInfoEnabled()) {
                        LOG.info(exc);
                    }
                }
            }
            setParamElementlanguage(defaultLocale.toString());
        } else {
            // body present, get the language
            if (locales.contains(defaultLocale)) {
                // get the body for the default language
                setParamElementlanguage(defaultLocale.toString());
            } else {
                // get the first body that can be found
                setParamElementlanguage(locales.get(0).toString());
            }

        }
    }