code: def _parse_dbus_locale():
      '''
      Get the 'System Locale' parameters from dbus
      '''
      bus = dbus.SystemBus()
      localed = bus.get_object('org.freedesktop.locale1',
                               '/org/freedesktop/locale1')
      properties = dbus.Interface(localed, 'org.freedesktop.DBus.Properties')
      system_locale = properties.Get('org.freedesktop.locale1', 'Locale')
  
      ret = {}
      for env_var in system_locale:
          env_var = six.text_type(env_var)
          match = re.match(r'^([A-Z_]+)=(.*)$', env_var)
          if match:
              ret[match.group(1)] = match.group(2).replace('"', '')
          else:
              log.error('Odd locale parameter "%s" detected in dbus locale '
                        'output. This should not happen. You should '
                        'probably investigate what caused this.', env_var)
  
      return ref _parse_dbus_locale():
      '''
      Get the 'System Locale' parameters from dbus
      '''
      bus = dbus.SystemBus()
      localed = bus.get_object('org.freedesktop.locale1',
                               '/org/freedesktop/locale1')
      properties = dbus.Interface(localed, 'org.freedesktop.DBus.Properties')
      system_locale = properties.Get('org.freedesktop.locale1', 'Locale')
  
      ret = {}
      for env_var in system_locale:
          env_var = six.text_type(env_var)
          match = re.match(r'^([A-Z_]+)=(.*)$', env_var)
          if match:
              ret[match.group(1)] = match.group(2).replace('"', '')
          else:
              log.error('Odd locale parameter "%s" detected in dbus locale '
                        'output. This should not happen. You should '
                        'probably investigate what caused this.', env_var)
  
      return ret
docs: Get the 'System Locale' parameters from dbus