mirror of https://github.com/zulip/zulip.git
emoji: Clean up strings for emoji errors.
The main goal here is to remove the use of the term "realm", but we also make these strings more consistent and using better English.
This commit is contained in:
parent
342d8cd4e0
commit
8fba40fdd5
|
@ -67,19 +67,19 @@ def check_emoji_request(realm: Realm, emoji_name: str, emoji_code: str,
|
|||
realm_emojis = realm.get_emoji()
|
||||
realm_emoji = realm_emojis.get(emoji_code)
|
||||
if realm_emoji is None:
|
||||
raise JsonableError(_("No such realm emoji found."))
|
||||
raise JsonableError(_("Invalid custom emoji."))
|
||||
if realm_emoji["deactivated"]:
|
||||
raise JsonableError(_("This realm emoji has been deactivated."))
|
||||
raise JsonableError(_("This custom emoji has been deactivated."))
|
||||
if emoji_name != emoji_code:
|
||||
raise JsonableError(_("Invalid emoji name."))
|
||||
elif emoji_type == "zulip_extra_emoji":
|
||||
if emoji_code not in ["zulip"]:
|
||||
raise JsonableError(_("No such extra emoji found."))
|
||||
raise JsonableError(_("Invalid emoji code."))
|
||||
if emoji_name != emoji_code:
|
||||
raise JsonableError(_("Invalid emoji name."))
|
||||
elif emoji_type == "unicode_emoji":
|
||||
if emoji_code not in codepoint_to_name:
|
||||
raise JsonableError(_("No unicode emoji with this emoji code found."))
|
||||
raise JsonableError(_("Invalid emoji code."))
|
||||
if name_to_codepoint.get(emoji_name) != emoji_code:
|
||||
raise JsonableError(_("Invalid emoji name."))
|
||||
else:
|
||||
|
|
|
@ -404,7 +404,7 @@ class DefaultEmojiReactionTests(EmojiReactionBase):
|
|||
'emoji_code': 'TBD',
|
||||
}
|
||||
result = self.post_reaction(reaction_info)
|
||||
self.assert_json_error(result, 'No unicode emoji with this emoji code found.')
|
||||
self.assert_json_error(result, 'Invalid emoji code.')
|
||||
|
||||
def test_add_default_emoji_invalid_name(self) -> None:
|
||||
reaction_info = {
|
||||
|
@ -550,7 +550,7 @@ class ZulipExtraEmojiReactionTest(EmojiReactionBase):
|
|||
'reaction_type': 'zulip_extra_emoji',
|
||||
}
|
||||
result = self.post_reaction(reaction_info)
|
||||
self.assert_json_error(result, 'No such extra emoji found.')
|
||||
self.assert_json_error(result, 'Invalid emoji code.')
|
||||
|
||||
def test_add_invalid_emoji_name(self) -> None:
|
||||
reaction_info = {
|
||||
|
@ -587,7 +587,7 @@ class RealmEmojiReactionTests(EmojiReactionBase):
|
|||
'emoji_code': 'non_existent',
|
||||
}
|
||||
result = self.post_reaction(reaction_info)
|
||||
self.assert_json_error(result, 'No such realm emoji found.')
|
||||
self.assert_json_error(result, 'Invalid custom emoji.')
|
||||
|
||||
def test_add_realm_emoji_invalid_name(self) -> None:
|
||||
reaction_info = {
|
||||
|
@ -607,7 +607,7 @@ class RealmEmojiReactionTests(EmojiReactionBase):
|
|||
'emoji_code': 'green_tick',
|
||||
}
|
||||
result = self.post_reaction(reaction_info)
|
||||
self.assert_json_error(result, 'This realm emoji has been deactivated.')
|
||||
self.assert_json_error(result, 'This custom emoji has been deactivated.')
|
||||
|
||||
def test_add_to_existing_deactivated_realm_emoji_reaction(self) -> None:
|
||||
reaction_info = {
|
||||
|
|
Loading…
Reference in New Issue