Changes the default locale

@param representation locale representation
@return result
@throws java.net.URISyntaxException if URI is not valid
545589
@PUT
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    @RequiresPermissions(I18nPermissions.LOCALE_WRITE)
    public Response changeDefaultLocale(LocaleRepresentation representation) throws URISyntaxException {
        WebAssertions.assertNotNull(representation, "The locale should not be null");
        WebAssertions.assertNotBlank(representation.getCode(), "The locale code should not be blank");
        try {
            localeService.changeDefaultLocaleTo(representation.getCode());
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            return Response.status(Response.Status.NOT_FOUND).build();
        }

        return Response.ok(new URI(uriInfo.getRequestUri().toString()))
                .entity(localeFinder.findDefaultLocale()).build();
    }
370535
public void setFillTranslate( Float[] value) {
    PropertyValue propertyValue = fillTranslate(value);
    constantPropertyUsageMap.put(PROPERTY_FILL_TRANSLATE, propertyValue);
    layer.setProperties(propertyValue);
  }
9673
@Override
	protected void setInitURI(String uriString) throws CadiException {
		try {
			initURI = new URI(uriString);
		} catch (URISyntaxException e) {
			throw new CadiException(e);
		}
	}
894371
@Override
    public Locale calculateLocale(FacesContext facesContext)
    {
        Application application = facesContext.getApplication();
        for (Iterator<Locale> requestLocales = facesContext.getExternalContext().getRequestLocales(); requestLocales
                .hasNext();)
        {
            Locale requestLocale = requestLocales.next();
            for (Iterator<Locale> supportedLocales = application.getSupportedLocales(); supportedLocales.hasNext();)
            {
                Locale supportedLocale = supportedLocales.next();
                // higher priority to a language match over an exact match
                // that occurs further down (see JSTL Reference 1.0 8.3.1)
                if (requestLocale.getLanguage().equals(supportedLocale.getLanguage())
                        && (supportedLocale.getCountry() == null || supportedLocale.getCountry().length() == 0))
                {
                    return supportedLocale;
                }
                else if (supportedLocale.equals(requestLocale))
                {
                    return supportedLocale;
                }
            }
        }

        Locale defaultLocale = application.getDefaultLocale();
        return defaultLocale != null ? defaultLocale : Locale.getDefault();
    }
1245331
function setLocale(newLocale) {
      this.locale = newLocale;
      var invertedObjs = tia.cU.invertMapObj(newLocale);

      this.invertedLocaleFirstKey = invertedObjs.invertedMapFirstKey;
      this.invertedLocaleAllKeys = invertedObjs.invertedMapAllKeys;

      return {
        locale: this.locale,
        invertedLocaleFirstKey: invertedObjs.invertedMapFirstKey,
        invertedLocaleAllKeys: invertedObjs.invertedMapAllKeys,
      };
    }
227659
public void addDefaultLocale(String localeName) {

        Locale locale = getLocale(localeName);
        if (!m_defaultLocales.contains(locale)) {
            m_defaultLocales.add(locale);
            if (CmsLog.INIT.isInfoEnabled()) {
                CmsLog.INIT.info(
                    Messages.get().getBundle().key(
                        Messages.INIT_I18N_CONFIG_DEFAULT_LOCALE_2,
                        new Integer(m_defaultLocales.size()),
                        locale));

            }
        }
    }
661561
def locale(self, value):
        
        if value == self._defaults['ai.device.locale'] and 'ai.device.locale' in self._values:
            del self._values['ai.device.locale']
        else:
            self._values['ai.device.locale'] = value
1325810
public void setLineTranslate( Float[] value) {
    PropertyValue propertyValue = lineTranslate(value);
    constantPropertyUsageMap.put(PROPERTY_LINE_TRANSLATE, propertyValue);
    layer.setProperties(propertyValue);
  }
140755
public void setURI( String uriString, boolean encoded ) throws URISyntaxException
    {
        if ( uriString == null )
        {
            setScheme( null );
            setUserInfo( null );
            setHost( null );
            setPort( UNDEFINED_PORT );
            setPath( null );
            setQuery( null );
            setFragment( null );
        }
        else
        {
            URI uri = null;

            if ( encoded )
            {
                // Get (parse) the components using java.net.URI
                uri = new URI( uriString );
            }
            else
            {
                // Parse, then encode this string into its components using URI
                uri = encodeURI( uriString );
            }

            setURI( uri );
        }
    }
540316
public void setLocale(Locale l) {
		if (!initialized) {
			super.setLocale(l);
		} else {
			Locale oldLocale = locale;
			locale = l;
			dayChooser.setLocale(locale);
			monthChooser.setLocale(locale);
			firePropertyChange("locale", oldLocale, locale);
		}
	}
835452
public void setLocale(String locale) {

        try {
            m_locale = LocaleUtils.toLocale(locale);
        } catch (IllegalArgumentException e) {
            LOG.error(Messages.get().getBundle().key(Messages.ERR_TAG_INVALID_LOCALE_1, "cms:navigation"), e);
            m_locale = null;
        }
    }
1211030
public void setIconTranslate( Float[] value) {
    PropertyValue propertyValue = iconTranslate(value);
    constantPropertyUsageMap.put(PROPERTY_ICON_TRANSLATE, propertyValue);
    layer.setProperties(propertyValue);
  }
590286
public void setLocale(Locale locale) {
		for (int i = 0; i < 5; i++) {
			components[i].setLocale(locale);
		}
	}
249352
public void addLocale(String locale) {

        m_searchObject.setLocale(locale);
        m_searchObjectChanged = true;
        ValueChangeEvent.fire(this, m_searchObject);
    }
46038
public void setLocale(final Locale locale) {
        if (!equals(this.locale, locale)) {
            this.locale = locale;
            super.setValue(toString(locale));
            i18nBundleProvider.reloadBundles(locale);
        }
    }
667496
public void setLocale(Locale l) {
		super.setLocale(l);
		dateEditor.setLocale(l);
		jcalendar.setLocale(l);
	}
1321845
public static Locale localeForString(String localeString) {
        if (localeString == null || localeString.isEmpty()) {
            return null;
        }
        Locale locale;
        String[] localeParts = localeString.split("_");
        switch (localeParts.length) {
            case 1:
                locale = new Locale(localeParts[0]);
                break;
            case 2:
                locale = new Locale(localeParts[0], localeParts[1]);
                break;
            default:
                // Use default for 3 and above, merge the parts back and put them all in the varient
                StringBuilder varient = new StringBuilder(localeParts[2]);
                for (int i = 3; i < localeParts.length; i++) {
                    varient.append("_");
                    varient.append(localeParts[i]);
                }
                locale = new Locale(localeParts[0], localeParts[1], varient.toString());
                break;
        }
        return locale;
    }