Sets the specified locale into session of the specified request.

<p>
If no session of the specified request, do nothing.
</p>

@param request the specified request
@param locale  a new locale
358305
public static void setLocale(final HttpServletRequest request, final Locale locale) {
        final HttpSession session = request.getSession(false);

        if (null == session) {
            LOGGER.warn("Ignores set locale caused by no session");

            return;
        }

        session.setAttribute(Keys.LOCALE, locale);
        LOGGER.log(Level.DEBUG, "Client[sessionId={0}] sets locale to [{1}]", new Object[]{session.getId(), locale.toString()});
    }
116786
public static void setLocale(ProjectProperties properties, Locale locale)
   {
      properties.setMpxDelimiter(LocaleData.getChar(locale, LocaleData.FILE_DELIMITER));
      properties.setMpxProgramName(LocaleData.getString(locale, LocaleData.PROGRAM_NAME));
      properties.setMpxCodePage((CodePage) LocaleData.getObject(locale, LocaleData.CODE_PAGE));

      properties.setCurrencySymbol(LocaleData.getString(locale, LocaleData.CURRENCY_SYMBOL));
      properties.setSymbolPosition((CurrencySymbolPosition) LocaleData.getObject(locale, LocaleData.CURRENCY_SYMBOL_POSITION));
      properties.setCurrencyDigits(LocaleData.getInteger(locale, LocaleData.CURRENCY_DIGITS));
      properties.setThousandsSeparator(LocaleData.getChar(locale, LocaleData.CURRENCY_THOUSANDS_SEPARATOR));
      properties.setDecimalSeparator(LocaleData.getChar(locale, LocaleData.CURRENCY_DECIMAL_SEPARATOR));

      properties.setDateOrder((DateOrder) LocaleData.getObject(locale, LocaleData.DATE_ORDER));
      properties.setTimeFormat((ProjectTimeFormat) LocaleData.getObject(locale, LocaleData.TIME_FORMAT));
      properties.setDefaultStartTime(DateHelper.getTimeFromMinutesPastMidnight(LocaleData.getInteger(locale, LocaleData.DEFAULT_START_TIME)));
      properties.setDateSeparator(LocaleData.getChar(locale, LocaleData.DATE_SEPARATOR));
      properties.setTimeSeparator(LocaleData.getChar(locale, LocaleData.TIME_SEPARATOR));
      properties.setAMText(LocaleData.getString(locale, LocaleData.AM_TEXT));
      properties.setPMText(LocaleData.getString(locale, LocaleData.PM_TEXT));
      properties.setDateFormat((ProjectDateFormat) LocaleData.getObject(locale, LocaleData.DATE_FORMAT));
      properties.setBarTextDateFormat((ProjectDateFormat) LocaleData.getObject(locale, LocaleData.DATE_FORMAT));
   }
762815
public void updateLocale(String locale) throws SecurityException {
	checkWriteAccess();
	boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
	if (!hasAccess) throw new SecurityException("no access to update regional setting");

	Element scope = _getRootElement("regional");
	scope.setAttribute("locale", locale.trim());
    }
138023
public function setLocale($locale) {
        $this->locale   = $locale;
        $this->language = substr($locale, 0, (strpos($locale, '-')));
        $this->messages = array();
    }
694649
protected void setSessionValue(final HttpServletRequest request, final String key,
      final Object value) {
    request.getSession(true).setAttribute(key, value);
  }
1308770
public void setLocale(Locale locale) throws CmsException {

        CmsUserSettings settings = getSettings();
        if (settings != null) {
            settings.setLocale(locale);
            settings.save(m_cms);
            m_messages = Messages.get().getBundle(locale);
        }
    }
1027194
public static void bind(HttpServletRequest request) {
        if (request != null && threadLocal.get() != null) {
            throw new IllegalStateException("HttpServletRequestHolder.bind() called for a "
                    + "thread that already has a request associated with it. It's likely that the request "
                    + "was not correctly removed from the thread before it is put back into the thread pool.");
        }
        threadLocal.set(request);
    }
1046294
public SetDomainOriginResponse setDomainOrigin(SetDomainOriginRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");
        InternalRequest internalRequest = createRequest(request, HttpMethodName.PUT, DOMAIN, request.getDomain(), "config");
        internalRequest.addParameter("origin","");
        this.attachRequestToBody(request, internalRequest);
        return invokeHttpClient(internalRequest, SetDomainOriginResponse.class);
    }
1223612
protected void setLocale( Locale locale )
    {
        if ( locale == null ) locale = getDefaultLocale();
        getSession().setAttribute( Globals.LOCALE_KEY, locale );
    }
612597
public void setLocales(Locale... locales) {

    String[] array = new String[locales.length];
    for (int i = 0; i < locales.length; i++) {
      array[i] = locales[i].toString();
    }
    setLocales(array);
  }
363755
public void setContentLocale(Locale locale) {

        m_contentLocale = locale;
        m_dateFieldKey = CmsSearchField.FIELD_INSTANCEDATE + "_" + m_contentLocale.toString() + "_dt";
    }
19109
public void setRequest(Object request)
    {
        ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
        
        if (ctx == null)
        {
            throw new UnsupportedOperationException();
        }
        
        ctx.setRequest(request);
    }
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);
	}
840462
@Override
	public void setValue(String value, java.util.Locale locale) {
		_cpDefinitionSpecificationOptionValue.setValue(value, locale);
	}
357569
protected void loadOtherLocale(final String locale) {

        CmsRpcAction<CmsPreviewInfo> previewAction = new CmsRpcAction<CmsPreviewInfo>() {

            @SuppressWarnings("synthetic-access")
            @Override
            public void execute() {

                if (m_previewInfoProvider != null) {
                    m_previewInfoProvider.loadPreviewForLocale(locale, this);
                } else {
                    CmsCoreProvider.getVfsService().getPreviewInfo(getSitePath(), locale, this);
                }
                start(0, true);
            }

            @Override
            protected void onResponse(CmsPreviewInfo result) {

                stop(false);
                updatePreviewContent(result);
            }
        };
        previewAction.execute();
    }
1193497
public function setLocale()
    {
        if ($locale = $this->app->session->get('administrator_locale')) {
            $this->app->setLocale($locale);
        }
    }
56782
protected Locale getLocale( HttpServletRequest request )
    {

        HttpSession session = request.getSession();
        Locale locale = ( Locale ) session.getAttribute( Globals.LOCALE_KEY );
        return locale != null ? locale : DEFAULT_LOCALE;
    }