def get_locale():
    '''
    Get the current system locale

    CLI Example:

    .. code-block:: bash

        salt '*' locale.get_locale
    '''
    cmd = ''
    if salt.utils.systemd.booted(__context__):
        params = _parse_dbus_locale() if HAS_DBUS else _parse_localectl()
        return params.get('LANG', '')
    elif 'RedHat' in __grains__['os_family']:
        cmd = 'grep "^LANG=" /etc/sysconfig/i18n'
    elif 'Suse' in __grains__['os_family']:
        cmd = 'grep "^RC_LANG" /etc/sysconfig/language'
    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: Unsupported platform!')

    try:
        return __salt__['cmd.run'](cmd).split('=')[1].replace('"', '')
    except __HOLE__:
        return ''
dataset/ETHPy150Open saltstack/salt/salt/modules/localemod.py/get_locale