Return the system locale
    :return: the system locale (as a string)
492396
def i18n_system_locale():
    
    log.debug('i18n_system_locale() called')
    lc, encoding = locale.getlocale()
    log.debug('locale.getlocale() = (lc="{lc}", encoding="{encoding}).'.format(lc=lc, encoding=encoding))
    if lc is None:
        lc, encoding = locale.getdefaultlocale()
        log.debug('locale.getdefaultlocale() = (lc="{lc}", encoding="{encoding}).'.format(lc=lc, encoding=encoding))
    return lc
307994
public function getLocale(): string
    {
        if (is_null($this->locale)) {
            $this->locale = \Locale::getDefault();
        }

        return $this->locale;
    }
924960
public static Locale getLocale() {
        final Locale ret = LOCALE.get();
        if (null == ret) {
            return Latkes.getLocale();
        }

        return ret;
    }
311939
public static function getLocale()
    {
        static::getDefaultLocale();
        $current = Locale::getDefault();
        if ($current === '') {
            $current = static::DEFAULT_LOCALE;
            Locale::setDefault($current);
        }

        return $current;
    }
253818
public String getLanguage(boolean bCheckLocaleAlso)
    {
        String strLanguage = this.getProperty(Params.LANGUAGE);
        if ((strLanguage == null) || (strLanguage.length() == 0))
            if (bCheckLocaleAlso)
                return Locale.getDefault().getLanguage();
        return strLanguage;
    }
1238354
def get_locale():
    '''
    
    '''
    ret = ''
    lc_ctl = salt.utils.systemd.booted(__context__)
    # localectl on SLE12 is installed but the integration is still broken in latest SP3 due to
    # config is rewritten by by many %post installation hooks in the older packages.
    # If you use it -- you will break your config. This is not the case in SLE15 anymore.
    if lc_ctl and not (__grains__['os_family'] in ['Suse'] and __grains__['osmajorrelease'] in [12]):
        ret = (_parse_dbus_locale() if dbus is not None else _localectl_status()['system_locale']).get('LANG', '')
    else:
        if 'Suse' in __grains__['os_family']:
            cmd = 'grep "^RC_LANG" /etc/sysconfig/language'
        elif 'RedHat' in __grains__['os_family']:
            cmd = 'grep "^LANG=" /etc/sysconfig/i18n'
        elif 'Debian' in __grains__['os_family']:
            # this block only applies to Debian without systemd
            cmd = 'grep "^LANG=" /etc/default/locale'
        elif 'Gentoo' in __grains__['os_family']:
            cmd = 'eselect --brief locale show'
            return __salt__['cmd.run'](cmd).strip()
        elif 'Solaris' in __grains__['os_family']:
            cmd = 'grep "^LANG=" /etc/default/init'
        else:  # don't waste time on a failing cmd.run
            raise CommandExecutionError('Error: "{0}" is unsupported!'.format(__grains__['oscodename']))

        if cmd:
            try:
                ret = __salt__['cmd.run'](cmd).split('=')[1].replace('"', '')
            except IndexError as err:
                log.error('Error occurred while running "%s": %s', cmd, err)

    return ret
1144567
def get_locales(self, package_name):
        
        self._analyse()
        return list(self.values[package_name].keys())
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();
    }
258083
public Locale getLocale() {
        if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){
            checkRequestObjectInUse();
        }
        processLocales();
        // 321485
        Locale locale = (Locale) (_srtRequestHelper._locales.size() > 0 ? _srtRequestHelper._locales.get(0) : null);
        if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
            logger.logp(Level.FINE, CLASS_NAME,"getLocale", "this->"+this+": "+" locale --> " + (locale!=null?locale.toString():""));
        }
        return locale;
    }
628852
public String getLocalizedName(Locale locale) {

        if (m_messageContainer != null) {
            return m_messageContainer.key(locale);
        }
        return m_key;
    }
1049793
public String getDescription(Locale locale) {

        if (m_systemRole) {
            // localize role names for system roles
            return Messages.get().getBundle(locale).key("GUI_ROLE_DESCRIPTION_" + m_roleName + "_0");
        } else {
            return getName(locale);
        }
    }
640019
public static function getLocale()
    {
        if (empty(self::$locale)) {
            self::$locale = new StringType(\locale_get_default());
        }

        return self::$locale;
    }
367130
def locale(self) -> babel.core.Locale or None:
        
        if not self.language_code:
            return None
        if not hasattr(self, '_locale'):
            setattr(self, '_locale', babel.core.Locale.parse(self.language_code, sep='-'))
        return getattr(self, '_locale')
454101
@Override
    public Locale getLocale() {
        if (super.getSession(false) == null) {
            return super.getLocale();
        }

        final IUserInstance userInstance =
                this.userInstanceManager.getUserInstance(this.getWrappedRequest());
        final LocaleManager localeManager = userInstance.getLocaleManager();
        final List<Locale> locales = localeManager.getLocales();
        return locales.get(0);
    }
107334
private Locale getUserLocale(IPerson user) {
        // get user locale
        Locale[] locales = localeStore.getUserLocales(user);
        LocaleManager localeManager =
                localeManagerFactory.createLocaleManager(user, Arrays.asList(locales));
        return localeManager.getLocales().get(0);
    }
367955
private static String osString()
    {
        OSType osType = calculateOS();
        return osType.toString().toLowerCase(Locale.ENGLISH);
    }
473604
private Locale getLocale(FacesContext context) {

        // PENDING(craigmcc) - JSTL localization context?
        Locale locale = this.locale;
        if (locale == null) {
            locale = context.getViewRoot().getLocale();
        }
        return (locale);

    }