stream settings: Add period at the end of error messages.

This commit is contained in:
YJDave
2018-01-09 00:24:19 +05:30
committed by showell
parent 1324d2e3c0
commit 8905744bb1
4 changed files with 10 additions and 10 deletions

View File

@@ -484,14 +484,14 @@ $(function () {
stream_events.mark_subscribed(sub);
}
} else {
stream_subscription_info_elem.text(i18n.t("User already subscribed"));
stream_subscription_info_elem.text(i18n.t("User already subscribed."));
}
stream_subscription_info_elem.addClass("text-success")
.removeClass("text-error");
}
function invite_failure() {
stream_subscription_info_elem.text(i18n.t("Could not add user to this stream"))
stream_subscription_info_elem.text(i18n.t("Could not add user to this stream."))
.addClass("text-error")
.removeClass("text-success");
}
@@ -528,14 +528,14 @@ $(function () {
stream_events.mark_unsubscribed(sub);
}
} else {
stream_subscription_info_elem.text(i18n.t("User is already not subscribed"));
stream_subscription_info_elem.text(i18n.t("User is already not subscribed."));
}
stream_subscription_info_elem.addClass('text-success')
.removeClass('text-error');
}
function removal_failure() {
stream_subscription_info_elem.text(i18n.t("Error removing user from this stream"))
stream_subscription_info_elem.text(i18n.t("Error removing user from this stream."))
.addClass("text-error")
.removeClass("text-success");
}

View File

@@ -1715,7 +1715,7 @@ def check_stream_name(stream_name: Text) -> None:
if stream_name.strip() == "":
raise JsonableError(_("Invalid stream name '%s'" % (stream_name)))
if len(stream_name) > Stream.MAX_NAME_LENGTH:
raise JsonableError(_("Stream name too long (limit: %s characters)" % (Stream.MAX_NAME_LENGTH)))
raise JsonableError(_("Stream name too long (limit: %s characters)." % (Stream.MAX_NAME_LENGTH)))
if set(stream_name).intersection(Stream.NAME_INVALID_CHARS):
raise JsonableError(_("Invalid characters in stream name (disallowed characters: %s)."
% ((', ').join(Stream.NAME_INVALID_CHARS))))

View File

@@ -80,7 +80,7 @@ def check_stream_name_available(realm: Realm, name: Text) -> None:
check_stream_name(name)
try:
get_stream(name, realm)
raise JsonableError(_("Stream name '%s' is already taken") % (name,))
raise JsonableError(_("Stream name '%s' is already taken.") % (name,))
except Stream.DoesNotExist:
pass

View File

@@ -308,10 +308,10 @@ class StreamAdminTest(ZulipTestCase):
self.assert_json_error(result, "Stream already has that name!")
result = self.client_patch('/json/streams/%d' % (stream.id,),
{'new_name': ujson.dumps('Denmark')})
self.assert_json_error(result, "Stream name 'Denmark' is already taken")
self.assert_json_error(result, "Stream name 'Denmark' is already taken.")
result = self.client_patch('/json/streams/%d' % (stream.id,),
{'new_name': ujson.dumps('denmark ')})
self.assert_json_error(result, "Stream name 'denmark' is already taken")
self.assert_json_error(result, "Stream name 'denmark' is already taken.")
# Do a rename that is case-only--this should succeed.
result = self.client_patch('/json/streams/%d' % (stream.id,),
@@ -1338,7 +1338,7 @@ class SubscriptionRestApiTest(ZulipTestCase):
}
result = self.api_patch(email, "/api/v1/users/me/subscriptions", request)
self.assert_json_error(result,
"Stream name too long (limit: 60 characters)")
"Stream name too long (limit: 60 characters).")
def test_stream_name_has_invalid_characters(self) -> None:
email = self.example_email('hamlet')
@@ -1651,7 +1651,7 @@ class SubscriptionAPITest(ZulipTestCase):
long_stream_name = "a" * 61
result = self.common_subscribe_to_streams(self.test_email, [long_stream_name])
self.assert_json_error(result,
"Stream name too long (limit: 60 characters)")
"Stream name too long (limit: 60 characters).")
def test_subscriptions_add_stream_with_null(self) -> None:
"""