Returns a map of the locale group for the current resource, with locale strings as keys.<p>

@return a map with locale strings as keys and resource wrappers for the corresponding locale variants
425115
public Map<String, CmsJspResourceWrapper> getLocaleResource() {

        if (m_localeResources != null) {
            return m_localeResources;
        }
        try {
            CmsLocaleGroup localeGroup = m_cms.getLocaleGroupService().readLocaleGroup(this);
            Map<Locale, CmsResource> resourcesByLocale = localeGroup.getResourcesByLocale();
            Map<String, CmsJspResourceWrapper> result = Maps.newHashMap();
            for (Map.Entry<Locale, CmsResource> entry : resourcesByLocale.entrySet()) {
                result.put(entry.getKey().toString(), CmsJspResourceWrapper.wrap(m_cms, entry.getValue()));
            }
            m_localeResources = result;
            return result;
        } catch (CmsException e) {
            return new HashMap<String, CmsJspResourceWrapper>();
        }
    }
1165849
private Locale getLocale() throws CmsException {

        getDocument();
        List<Locale> locales = m_document.getLocales();
        if (locales.contains(Locale.ENGLISH) || locales.isEmpty()) {
            return Locale.ENGLISH;
        }
        return locales.get(0);
    }
640772
public String get(final String key, final Locale locale) {
        return get(Keys.LANGUAGE, key, locale);
    }
905657
private Locale getWorkplaceLocale() {

        Locale result = OpenCms.getWorkplaceManager().getWorkplaceLocale(getCmsObject());
        if (result == null) {
            result = CmsLocaleManager.getDefaultLocale();
        }
        if (result == null) {
            result = Locale.getDefault();
        }
        return result;
    }
223407
public Locale getLocale()
    {
        Enumeration enm = _httpRequest.getFieldValues(HttpFields.__AcceptLanguage,
                                                       HttpFields.__separators);

        // handle no locale
        if (enm == null || !enm.hasMoreElements())
            return Locale.getDefault();
        
        // sort the list in quality order
        List acceptLanguage = HttpFields.qualityList(enm);
        if (acceptLanguage.size()==0)
            return  Locale.getDefault();

        int size=acceptLanguage.size();
        
        // convert to locals
        for (int i=0; i<size; i++)
        {
            String language = (String)acceptLanguage.get(i);
            language=HttpFields.valueParameters(language,null);
            String country = "";
            int dash = language.indexOf('-');
            if (dash > -1)
            {
                country = language.substring(dash + 1).trim();
                language = language.substring(0,dash).trim();
            }
            return new Locale(language,country);
        }

        return  Locale.getDefault();
    }
973850
public List getLocaleConfigOptions() {

        List result = new ArrayList();

        List locales = OpenCms.getLocaleManager().getAvailableLocales();
        Iterator i = locales.iterator();
        while (i.hasNext()) {
            Locale locale = (Locale)i.next();
            String localeStr = locale.toString();
            String localeDisplayStr = locale.getDisplayName(getLocale());

            result.add(new CmsSelectWidgetOption(localeStr, false, localeDisplayStr));
        }

        return result;
    }
152139
public List<Locale> getAvailableLocales(CmsObject cms, CmsResource resource) {

        String availableNames = null;
        try {
            availableNames = cms.readPropertyObject(
                resource,
                CmsPropertyDefinition.PROPERTY_AVAILABLE_LOCALES,
                true).getValue();
        } catch (CmsException exc) {
            LOG.debug("Could not read available locales property for resource " + resource.getRootPath(), exc);
        }

        List<Locale> result = null;
        if (availableNames != null) {
            result = getAvailableLocales(availableNames);
        }
        if ((result == null) || (result.size() == 0)) {
            return Collections.unmodifiableList(m_availableLocales);
        } else {
            return result;
        }
    }
421633
public List<Locale> getLocales() {
        // Need logic to construct ordered locale list.
        // Consider creating a separate ILocaleResolver
        // interface to do this work.
        final List rslt = new ArrayList();
        // Add highest priority locales first
        addToLocaleList(rslt, sessionLocales);
        addToLocaleList(rslt, userLocales);
        // We will ignore browser locales until we know how to
        // translate them into proper java.util.Locales
        // addToLocaleList(locales, browserLocales);
        addToLocaleList(rslt, portalLocales);
        return rslt;
    }
477552
public Map<String, String> getResourcePathToUriMappings() {
    if (resourcePathToUriMappings == null) {
      ImmutableMap.Builder<String, String> mapBuilder = ImmutableMap.<String, String>builder();
      // Ensure that resourcePath and uri ends with a '/'
      for (Map.Entry<String, String> mapping : mappings().entrySet()) {
        mapBuilder
            .put(ensureEndsWithSlash(mapping.getKey()), ensureEndsWithSlash(mapping.getValue()));
      }
      resourcePathToUriMappings = mapBuilder.build();
    }
    return resourcePathToUriMappings;
  }
1052700
@Override
    public Enumeration<Locale> getLocales() {
        if (super.getSession(false) == null) {
            return super.getLocales();
        }

        final IUserInstance userInstance =
                this.userInstanceManager.getUserInstance(this.getWrappedRequest());
        final LocaleManager localeManager = userInstance.getLocaleManager();
        final List<Locale> locales = localeManager.getLocales();
        return Collections.enumeration(locales);
    }
424390
public Map<String, String> getTitleLocale() {

        if (m_localeTitles == null) {
            m_localeTitles = CmsCollectionsGenericWrapper.createLazyMap(new Transformer() {

                public Object transform(Object inputLocale) {

                    Locale locale = null;
                    if (null != inputLocale) {
                        if (inputLocale instanceof Locale) {
                            locale = (Locale)inputLocale;
                        } else if (inputLocale instanceof String) {
                            try {
                                locale = LocaleUtils.toLocale((String)inputLocale);
                            } catch (IllegalArgumentException | NullPointerException e) {
                                // do nothing, just go on without locale
                            }
                        }
                    }
                    return getLocaleSpecificTitle(locale);
                }

            });
        }
        return m_localeTitles;
    }
718615
public Locale getLocale() {
		Locale l = wbRequest.getLocale();
		if (l == null) {
			l = Locale.getAvailableLocales()[0];
		}
		return l;
	}
831492
public static List<Locale> getLocales(String localeNames) {

        if (localeNames == null) {
            return null;
        }
        return getLocales(CmsStringUtil.splitAsList(localeNames, ','));
    }
1114035
public Locale getLand() {
        String kennung = this.getLandeskennung();
        switch (kennung) {
            case "D":   return new Locale("de", "DE");
            case "A":   return new Locale("de", "AT");
            case "CH":  return new Locale("de", "CH");
            default:    throw new UnsupportedOperationException("unbekannte Landeskennung '" + kennung + "'");
        }
    }
1090783
private Map<Locale, Map<String, String>> getData() {

        @SuppressWarnings("unchecked")
        Map<Locale, Map<String, String>> result = (Map<Locale, Map<String, String>>)m_cache.getCachedObject(
            m_cms,
            getFilePath());
        if (result == null) {
            try {
                result = m_loader.loadData(m_cms, m_parameters);
                m_cache.putCachedObject(m_cms, getFilePath(), result);
            } catch (Exception e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
        return result;
    }
988883
public List<LocaleBean> getLocales(Locale currentLocale) {
        List<LocaleBean> locales = new ArrayList<>();

        // get the array of locales available from the portal
        List<Locale> portalLocales = localeManagerFactory.getPortalLocales();
        for (Locale locale : portalLocales) {
            if (currentLocale != null) {
                // if a current locale is available, display language names
                // using the current locale
                locales.add(new LocaleBean(locale, currentLocale));
            } else {
                locales.add(new LocaleBean(locale));
            }
        }
        return locales;
    }
703432
protected Locale ensureLocale(Locale locale) {

        // get the default locale for the resource
        List<Locale> locales = OpenCms.getLocaleManager().getDefaultLocales(getCms(), getParamResource());
        if (m_content != null) {
            if (!m_content.hasLocale(locale)) {
                try {

                    // to copy anything we need at least one locale
                    if ((m_content.getLocales().size() > 0)) {
                        // required locale not available, check if an existing default locale should be copied as "template"
                        try {
                            // a list of possible default locales has been set as property, try to find a match
                            m_content.copyLocale(locales, locale);

                        } catch (CmsException e) {
                            m_content.addLocale(getCms(), locale);
                        }

                    } else {
                        m_content.addLocale(getCms(), locale);
                    }

                    writeContent();
                } catch (CmsException e) {
                    LOG.error(e.getMessageContainer(), e);
                }
            }
            if (!m_content.hasLocale(locale)) {
                // value may have changed because of the copy operation
                locale = m_content.getLocales().get(0);
            }
        }
        return locale;
    }