Set this property in the user's property area.
@return The language code.
426966
public String getLanguage(boolean bCheckLocaleAlso)
    {
        Record recUserInfo = (Record)this.getUserInfo();
        String strLanguage = null;
        if (recUserInfo != null)
            strLanguage = ((PropertiesField)recUserInfo.getField(UserInfoModel.PROPERTIES)).getProperty(DBParams.LANGUAGE);
        if ((strLanguage == null) || (strLanguage.length() == 0))
            strLanguage = super.getLanguage(bCheckLocaleAlso);
        return strLanguage;
    }
1155284
public Locale getEffectiveLocale() {

		// Priority 5: Default locale
		Locale locale = Locale.getDefault();
		boolean userHasLocaleString = false;

		if (cachedUser != null) {

			// Priority 2: User locale
			final String userLocaleString = cachedUser.getLocale();
			if (userLocaleString != null) {

				userHasLocaleString = true;

				try {
					locale = LocaleUtils.toLocale(userLocaleString);
				} catch (IllegalArgumentException e) {
					locale = Locale.forLanguageTag(userLocaleString);
				}
			}

		}

		if (request != null) {

			if (!userHasLocaleString) {

				// Priority 4: Browser locale
				locale = request.getLocale();

				final Cookie[] cookies = request.getCookies();

				if (cookies != null) {

					// Priority 3: Cookie locale
					for (Cookie c : cookies) {

						if (c.getName().equals(LOCALE_KEY)) {

							final String cookieLocaleString = c.getValue();

							try {
								locale = LocaleUtils.toLocale(cookieLocaleString);
							} catch (IllegalArgumentException e) {
								locale = Locale.forLanguageTag(cookieLocaleString);
							}

						}

					}

				}

			}

			// Priority 1: URL parameter locale
			String requestedLocaleString = request.getParameter(LOCALE_KEY);
			if (StringUtils.isNotBlank(requestedLocaleString)) {
				try {
					locale = LocaleUtils.toLocale(requestedLocaleString);
				} catch (IllegalArgumentException e) {
					locale = Locale.forLanguageTag(requestedLocaleString);
				}
			}

		}

		return locale;
	}
891245
public Locale getLocale() {
        UI currentUI = UI.getCurrent();
        Locale locale = currentUI == null ? null : currentUI.getLocale();
        if (locale == null) {
            locale = Locale.getDefault();
        }
        return locale;
    }
640528
@InterfaceAudience.Public
    public Map<String, Object> getUserProperties() {
        return getCurrentRevision() == null ? null : getCurrentRevision().getUserProperties();
    }
1080480
public static Locale getCurrentLocale() {
		if (FIXED_LOCALE != null) {
			return FIXED_LOCALE;
		}
		final Locale currentLocale = LOCALE_CONTEXT.get();
		if (currentLocale == null) {
			return Locale.getDefault();
		}
		return currentLocale;
	}
599542
function (userId, locale) {
                userId = userId || this.$.shopId;
                locale = locale || this.$.locale;


                var properties = {
                    userId: userId
                };

                if (locale) {
                    properties.locale = locale;
                }

                return this.getContext(properties);
            }
1068805
protected function setSystemLocale()
    {
        $u = new User();
        $lan = $u->getUserLanguageToDisplay();
        $loc = Localization::getInstance();
        $loc->setContextLocale(Localization::CONTEXT_UI, $lan);
    }
1048985
public function setLocale()
    {
        $locale = app('session')->get('administrator_locale');

        if ($locale) {
            $this->app->translator->setLocale($locale);
        }
    }
1368297
public function getLanguageCode() {

		if (!$this->issetCache('lang')) {
	
			$query =
				'SELECT l.code' .
				' FROM `languages` AS l' .
				' INNER JOIN `locales` AS lc ON l.id = lc.language_id' .
				' INNER JOIN `users` AS u ON u.locale_id = lc.id' .
				' WHERE u.id = ?';
			$this->db->setQuery($query);
			$this->setCache('lang', $this->db->loadResult($this->id));

		}
	
		return $this->getCache('lang');

	}
1300146
public function setLocale()
    {
        // Initialize Locale if set and configured.
        if ($this['language']->enabled() && $this['config']->get('system.languages.override_locale')) {
            $language = $this['language']->getLanguage();
            setlocale(LC_ALL, \strlen($language) < 3 ? ($language . '_' . strtoupper($language)) : $language);
        } elseif ($this['config']->get('system.default_locale')) {
            setlocale(LC_ALL, $this['config']->get('system.default_locale'));
        }
    }
408313
@Override
  public final void setLang(final Languages pLang) {
    this.lang = pLang;
    if (this.itsId == null) {
      this.itsId = new IdI18nUnitOfMeasure();
    }
    this.itsId.setLang(this.lang);
  }
1290063
public void setLanguage(Language language) {
        this.language = language;
        this.label.setText(language.getName());
        this.image.setUrl(language.getImage());
    }
1327824
@JSFProperty
    public Locale getLocale()
    {
        Object locale = getStateHelper().get(PropertyKeys.locale);
        if (locale != null)
        {
            return (Locale)locale;
        }
        ValueExpression expression = getValueExpression(PropertyKeys.locale.toString());
        if (expression != null)
        {
            Object veLocale = expression.getValue(getFacesContext().getELContext());
            if (veLocale instanceof Locale)
            {
                return (Locale) veLocale;
            }
            else
            {
                return (Locale) _LocaleUtils.toLocale(veLocale.toString());
            }
        }
        else
        {
            locale = getFacesContext().getApplication().getViewHandler().calculateLocale(getFacesContext());

            if (locale instanceof Locale)
            {
                return (Locale)locale;
            }
            else if (locale instanceof String)
            {
                return _LocaleUtils.toLocale((String)locale);
            }
        }

        return getFacesContext().getApplication().getViewHandler().calculateLocale(getFacesContext());
    }
589893
public Locale getLocale()
            throws JspException
    {
        Locale loc = null;
        if (_language != null || _country != null) {
            // language is required
            if (_language == null) {
                String s = Bundle.getString("Tags_LocaleRequiresLanguage", new Object[]{_country});
                registerTagError(s, null);
                return super.getUserLocale();
            }

            if (_country == null)
                loc = new Locale(_language);
            else
                loc = new Locale(_language, _country);
        }
        else
            loc = super.getUserLocale();

        return loc;
    }
836066
@Override
    public void setLocale(Locale inLocale) {
        if (isCommitted() || null == inLocale) {
            return;
        }
        this.locale = inLocale;
        if (null != this.outWriter || null != this.encoding) {
            return;
        }
        EncodingUtils encodingUtils = connection.getEncodingUtils();
        this.encoding = encodingUtils.getEncodingFromLocale(inLocale);
        if (null == this.encoding) {
            this.encoding = encodingUtils.getDefaultEncoding();
        }
        if (null != this.contentType) {
            int index = this.contentType.indexOf("charset=");
            StringBuilder sb = new StringBuilder();
            if (-1 != index) {
                sb.append(this.contentType.substring(0, index - 1).trim());
            }
            if (this.encoding != null) {
                sb.append(";charset=").append(this.encoding);
            }

            this.response.setHeader("Content-Type", sb.toString());
        }
    }
425775
public Object setProperty(String key, LangAlt value) {
		return super.setProperty(key, value.toString());
	 }
814707
public static Locale getEffectiveLocale() {
		Locale effectiveLocale = null;
		UIContext uic = UIContextHolder.getCurrent();

		if (uic != null) {
			effectiveLocale = uic.getLocale();
		}

		if (effectiveLocale == null) {
			String defaultLocale = ConfigurationProperties.getDefaultLocale();
			effectiveLocale = new Locale(defaultLocale);
		}

		// Don't use Locale.getDefault() because it is too nebulous (depends on host environment)

		return effectiveLocale;
	}