Gets the locale.<p>

@return the locale
546662
@Column(header = Messages.GUI_HISTORY_DIALOG_COL_LOCALE_0, order = 20)
    public String getLocale() {

        return m_elemComp.getLocale().toString();
    }
1001463
public CmsContainerPageBean getContainerPage(CmsObject cms) {

        Locale masterLocale = CmsLocaleManager.MASTER_LOCALE;
        Locale localeToLoad = null;
        // always use master locale if possible, otherwise use the first locale.
        // this is important for 'legacy' container pages which were created before container pages became locale independent
        if (m_cntPages.containsKey(masterLocale)) {
            localeToLoad = masterLocale;
        } else if (!m_cntPages.isEmpty()) {
            localeToLoad = m_cntPages.keySet().iterator().next();
        }
        if (localeToLoad == null) {
            return null;
        } else {
            CmsContainerPageBean result = m_cntPages.get(localeToLoad);
            return result;
        }
    }
187404
private Locale getLocale(CmsXmlContent content) {

        List<Locale> locales = content.getLocales();
        if (locales.contains(Locale.ENGLISH) || locales.isEmpty()) {
            return Locale.ENGLISH;
        }
        return locales.get(0);
    }
812970
public String getDescription(Locale locale) {

        CmsMacroResolver macroResolver = new CmsMacroResolver();
        macroResolver.setMessages(org.opencms.db.generic.Messages.get().getBundle(locale));
        return macroResolver.resolveMacros((String)getAdditionalInfo(CmsUserSettings.ADDITIONAL_INFO_DESCRIPTION));
    }
1092631
public Locale getElementLocale() {

        if (m_elementLocale == null) {
            if (CmsStringUtil.isNotEmpty(getParamElementlanguage()) && !"null".equals(getParamElementlanguage())) {
                m_elementLocale = CmsLocaleManager.getLocale(getParamElementlanguage());
            } else {
                initElementLanguage();
                m_elementLocale = CmsLocaleManager.getLocale(getParamElementlanguage());
            }
        }
        return m_elementLocale;
    }
1006678
protected String getLocaleSpecificTitle(Locale locale) {

        String result = null;

        try {

            if (isDetailRequest()) {
                // this is a request to a detail page
                CmsResource res = getDetailContent();
                CmsFile file = m_cms.readFile(res);
                CmsXmlContent content = CmsXmlContentFactory.unmarshal(m_cms, file);
                result = content.getHandler().getTitleMapping(m_cms, content, m_cms.getRequestContext().getLocale());
                if (result == null) {
                    // title not found, maybe no mapping OR not available in the current locale
                    // read the title of the detail resource as fall back (may contain mapping from another locale)
                    result = m_cms.readPropertyObject(
                        res,
                        CmsPropertyDefinition.PROPERTY_TITLE,
                        false,
                        locale).getValue();
                }
            }
            if (result == null) {
                // read the title of the requested resource as fall back
                result = m_cms.readPropertyObject(
                    m_cms.getRequestContext().getUri(),
                    CmsPropertyDefinition.PROPERTY_TITLE,
                    true,
                    locale).getValue();
            }
        } catch (CmsException e) {
            LOG.debug(e.getLocalizedMessage(), e);
        }
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(result)) {
            result = "";
        }

        return result;
    }
685871
@Override
    public String getLocalizedMessage() {

        if (m_exceptions.isEmpty()) {
            return null;
        }
        StringBuffer result = new StringBuffer(128);
        Iterator<CmsException> it = m_exceptions.iterator();
        while (it.hasNext()) {
            CmsException ex = it.next();
            result.append(ex.getLocalizedMessage());
            if (it.hasNext()) {
                result.append('\n');
            }
        }
        return result.toString();
    }
3262
public function getLocale() {
		if($this->locale === null)
			$this->locale = $this->getDefinition()->getEntityManager()->getDefaultLocale();
		return $this->locale;
	}
718615
public Locale getLocale() {
		Locale l = wbRequest.getLocale();
		if (l == null) {
			l = Locale.getAvailableLocales()[0];
		}
		return l;
	}
924960
public static Locale getLocale() {
        final Locale ret = LOCALE.get();
        if (null == ret) {
            return Latkes.getLocale();
        }

        return ret;
    }
543113
private List getLocales() {

        ArrayList ret = new ArrayList();

        try {
            Iterator i = OpenCms.getLocaleManager().getAvailableLocales().iterator();

            // loop through all local's and build the entries
            while (i.hasNext()) {
                Locale locale = (Locale)i.next();
                String language = locale.getLanguage();
                String displayLanguage = locale.getDisplayLanguage();

                ret.add(new CmsSelectWidgetOption(language, false, displayLanguage));
            }
        } catch (Exception e) {
            // not necessary
        }
        return ret;
    }
1230757
public Locale getMainTranslationLocale(Locale defaultValue) {

        Map<String, String> params = getParameters();
        String value = params.get(PARAM_MAIN_LOCALE);
        if (!CmsStringUtil.isEmpty(value)) {
            return CmsLocaleManager.getLocale(value);
        } else {
            return defaultValue;
        }
    }
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();
    }
1274735
public function getLocale()
	{
        $locales = explode(',', $this->_meta->locale);

		for($i = 0; $i < count($locales); $i++ ) {
			$locale = $locales[$i];
			$locale = trim($locale);
			$locales[$i] = $locale;
		}

		return $locales;
	}
494871
public Map<String, Map<String, String>> getPropertyLocale() {

        if (m_propertiesLocale == null) {
            m_propertiesLocale = CmsCollectionsGenericWrapper.createLazyMap(
                new CmsLocalePropertyLoaderTransformer(getCmsObject(), this, false));
            // result may still be null
            return (m_propertiesLocale == null) ? Collections.EMPTY_MAP : m_propertiesLocale;
        }
        return m_propertiesLocale;
    }
403573
public Map<String, Map<String, String>> getLocaleRdfa() {

        if (m_localeRdfa == null) {
            m_localeRdfa = CmsCollectionsGenericWrapper.createLazyMap(new CmsLocaleRdfaTransformer());
        }
        return m_localeRdfa;
    }
205157
protected Locale getLocaleToUse(CmsObject cms, CmsXmlContent xmlContent) {

        Locale contextLocale = cms.getRequestContext().getLocale();
        if (xmlContent.hasLocale(contextLocale)) {
            return contextLocale;
        }
        Locale defaultLocale = CmsLocaleManager.getDefaultLocale();
        if (xmlContent.hasLocale(defaultLocale)) {
            return defaultLocale;
        }
        if (!xmlContent.getLocales().isEmpty()) {
            return xmlContent.getLocales().get(0);
        } else {
            return defaultLocale;
        }
    }