Initializes the language switcher UI Component {@link #m_languageSwitch}, including {@link #m_languageSelect}.
@param locales the locales that can be selected.
@param current the currently selected locale.
545772
private void initLanguageSwitch(Collection<Locale> locales, Locale current) {

        FormLayout languages = new FormLayout();
        languages.setHeight("100%");
        languages.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
        ComboBox languageSelect = new ComboBox();
        languageSelect.setCaption(m_messages.key(Messages.GUI_LANGUAGE_SWITCHER_LABEL_0));
        languageSelect.setNullSelectionAllowed(false);

        // set Locales
        for (Locale locale : locales) {
            languageSelect.addItem(locale);
            String caption = locale.getDisplayName(UI.getCurrent().getLocale());
            if (CmsLocaleManager.getDefaultLocale().equals(locale)) {
                caption += " ("
                    + Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_DEFAULT_LOCALE_0)
                    + ")";
            }
            languageSelect.setItemCaption(locale, caption);
        }
        languageSelect.setValue(current);
        languageSelect.setNewItemsAllowed(false);
        languageSelect.setTextInputAllowed(false);
        languageSelect.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            public void valueChange(ValueChangeEvent event) {

                m_listener.handleLanguageChange((Locale)event.getProperty().getValue());

            }
        });

        if (locales.size() == 1) {
            languageSelect.setEnabled(false);
        }
        languages.addComponent(languageSelect);
        m_languageSwitch = languages;
    }
387326
public void setLocale(Locale newLocale) throws PropertyVetoException
	{
		if (newLocale == null || newLocale == locale)
		{
			return; // ignore null locale
		}

		PropertyChangeEvent event = new PropertyChangeEvent(beanContextChildPeer, "locale", locale, newLocale);

		// apply change
		Locale oldLocale = locale;
		locale = newLocale;

		try
		{
			// notify vetoable listeners
			vcSupport.fireVetoableChange(event);
		}
		catch (PropertyVetoException e)
		{
			// rollback change
			locale = oldLocale;
			throw e;
		}
		// Notify BeanContext about this change
		this.pcSupport.firePropertyChange(event);
	}
1217995
public void setLocale(Locale locale)
  {
    if(locale != null && report != null && report instanceof LocalizableReport) 
    {
      ((LocalizableReport) report).setLocale(locale); 
    }
  }
817764
protected void initHtmlReport(Locale locale) {

        m_report = new CmsWorkplaceReport(locale, m_cms.getRequestContext().getSiteRoot(), getLogChannel());
    }
781840
public static void setLocale(Locale l) throws IllegalArgumentException {

        synchronized (mutex) {
            if (l == null) {
                throw new IllegalArgumentException("null locale");
            }

            locale = l;
        }
    }
960321
private void init() {

        mTextToSpeech = new TextToSpeech(mContext, new OnInitListener() {

            @Override
            public void onInit(int status) {

                if (status == TextToSpeech.SUCCESS) {
                    checkCurrentLocale();
                    int result = mTextToSpeech.setLanguage(mLocale);

                    if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) {
                        mLocale = getDefaultLocale();
                        init();
                        Log.i(TAG, "set default locale (English US) for gvrAccessibility");
                    }
                }
            }
        });

    }
431264
public static Locale getCurrentLocale() {
        final UI currentUI = UI.getCurrent();
        return currentUI == null ? Locale.getDefault() : currentUI.getLocale();
    }
46038
public void setLocale(final Locale locale) {
        if (!equals(this.locale, locale)) {
            this.locale = locale;
            super.setValue(toString(locale));
            i18nBundleProvider.reloadBundles(locale);
        }
    }
1319157
public function setDefaultLocale($locale)
    {
        $this->defaultLocale = $locale;

        if (null === $this->locale) {
            $this->setPhpDefaultLocale($locale);
        }
    }
680605
private void initLocalizations(String[][] localizations) {
        if (localizations != null) {
            publicRuleSetNames = localizations[0].clone();

            Map<String, String[]> m = new HashMap<String, String[]>();
            for (int i = 1; i < localizations.length; ++i) {
                String[] data = localizations[i];
                String loc = data[0];
                String[] names = new String[data.length-1];
                if (names.length != publicRuleSetNames.length) {
                    throw new IllegalArgumentException("public name length: " + publicRuleSetNames.length +
                                                       " != localized names[" + i + "] length: " + names.length);
                }
                System.arraycopy(data, 1, names, 0, names.length);
                m.put(loc, names);
            }

            if (!m.isEmpty()) {
                ruleSetDisplayNames = m;
            }
        }
    }
1024277
protected void initElementLanguage() {

        // get the default locale for the resource
        List<Locale> locales = OpenCms.getLocaleManager().getDefaultLocales(getCms(), getParamResource());
        Locale locale = locales.get(0);
        locale = ensureLocale(locale);
        setParamElementlanguage(locale.toString());
    }
361842
public function setLocale($locale) {
		$this->locale = $locale;
		
		if ($this->checkTranslateObjectIsSet()) {
			$this->translation->setLocale($this->locale);
		}
	}
1223612
protected void setLocale( Locale locale )
    {
        if ( locale == null ) locale = getDefaultLocale();
        getSession().setAttribute( Globals.LOCALE_KEY, locale );
    }
590286
public void setLocale(Locale locale) {
		for (int i = 0; i < 5; i++) {
			components[i].setLocale(locale);
		}
	}
37302
public function setClientLocales($clientLocales): void
    {
        if(!$this->clientLocales)
            $this->clientLocales = new LocaleCollection();

        $this->clientLocales->removeAllLocales();

        foreach ($clientLocales as $locale) {
            if(is_string($locale)) {
                $locale = new Locale($locale);
            }

            if($locale instanceof Locale) {
                $this->clientLocales->addLocale($locale);
            }
        }
    }
983202
protected void setLocale(String strLocale) {
	if (strLocale == null) {
	    this.locale = Locale.US;
	}
	else {
	    try {
		this.locale = Caster.toLocale(strLocale);
		if (this.locale == null) this.locale = Locale.US;
	    }
	    catch (ExpressionException e) {
		this.locale = Locale.US;
	    }
	}
    }
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());
        }
    }