code: 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')
docs: Get user's locale
  
          :return: :class:`babel.core.Locale`