      def authenticate_credentials(self, key):
          try:
              token = self.model.objects.get(key=key)
          except self.model.DoesNotExist:
              raise exceptions.AuthenticationFailed('Invalid token')
  
          if not token.user.is_active:
              raise exceptions.AuthenticationFailed('User inactive or deleted')
  
          return (token.user, token)
 
</s> remove             raise exceptions.AuthenticationFailed('User inactive or deleted')
 </s> add             raise exceptions.AuthenticationFailed(_("User inactive or deleted")) </s> remove             msg = 'Invalid token header. Token string should not contain spaces.'
 </s> add             msg = _("Invalid token header. Token string should not contain spaces.") </s> remove             msg = 'Invalid token header. No credentials provided.'
 </s> add             msg = _("Invalid token header. No credentials provided.") </s> remove             raise exceptions.AuthenticationFailed('Invalid username/password')
 </s> add             raise exceptions.AuthenticationFailed(_("Invalid username/password.")) </s> remove             msg = 'Invalid basic header. Credentials not correctly base64 encoded'
 </s> add             msg = _("Invalid basic header. Credentials not correctly base64 encoded.")
            raise exceptions.AuthenticationFailed(_("Invalid token"))
      def authenticate_credentials(self, key):
          try:
              token = self.model.objects.get(key=key)
          except self.model.DoesNotExist:
            raise exceptions.AuthenticationFailed(_("Invalid token"))
  
          if not token.user.is_active:
              raise exceptions.AuthenticationFailed('User inactive or deleted')
  
          return (token.user, token)
keep keep keep keep replace keep keep keep keep keep
 use double quotes for user visible strings; end user visible strings in full stops; add some missing translation tags 
rest_framework/authentication.py