emoji: Enable Japanese characters in the symbol section.

This was originally meant to fix the emoji mapping conflict during a
Slack import. In Slack, 🎉 and ㊗️ have different
symbols, but they both map to 🎉 in Zulip prior to this commit.
㊗️ now refers to the Japanese character version, as is
observed in Matrix and Slack.

I expand the fix to include all other Japanese characters.  Matrix.org
and Slack already have those characters in their symbol section, and so
this is to reach feature parity.

See the discussion thread in https://chat.zulip.org/#narrow/stream/9-issues/topic/duplicate.20emoji.20in.20data.20import
This commit is contained in:
rht 2021-08-07 06:32:43 -04:00 committed by Tim Abbott
parent 78297efefd
commit 6bfebd5558
2 changed files with 18 additions and 19 deletions

View File

@ -21,7 +21,7 @@ run_test("initialize", () => {
const complete_emoji_catalog = _.sortBy(emoji_picker.complete_emoji_catalog, "name");
assert.equal(complete_emoji_catalog.length, 11);
assert.equal(emoji.emojis_by_name.size, 1037);
assert.equal(emoji.emojis_by_name.size, 1050);
let total_emoji_in_categories = 0;
@ -43,7 +43,7 @@ run_test("initialize", () => {
const popular_emoji_count = 6;
const zulip_emoji_count = 1;
assert_emoji_category(complete_emoji_catalog.pop(), "fa-car", 170);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-hashtag", 182);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-hashtag", 195);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-smile-o", 129);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-star-o", popular_emoji_count);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-thumbs-o-up", 102);

View File

@ -1188,8 +1188,7 @@ EMOJI_NAME_MAPS: Dict[str, Dict[str, Any]] = {
"1f38f": {"canonical_name": "carp_streamer", "aliases": ["flags"]},
"1f380": {"canonical_name": "ribbon", "aliases": ["decoration"]},
"1f38a": {"canonical_name": "confetti", "aliases": ["party_ball"]},
# seemed like the best congratulations
"1f389": {"canonical_name": "tada", "aliases": ["congratulations"]},
"1f389": {"canonical_name": "tada", "aliases": []},
"1f38e": {"canonical_name": "dolls", "aliases": []},
"1f3ee": {"canonical_name": "lantern", "aliases": ["izakaya_lantern"]},
"1f390": {"canonical_name": "wind_chime", "aliases": []},
@ -1321,28 +1320,28 @@ EMOJI_NAME_MAPS: Dict[str, Dict[str, Any]] = {
"2653": {"canonical_name": "pisces", "aliases": []},
"1f194": {"canonical_name": "id", "aliases": []},
"269b": {"canonical_name": "atom", "aliases": ["physics"]},
# japanese symbol
# '1f251': {'canonical_name': 'X', 'aliases': ['accept']},
"2622": {"canonical_name": "radioactive", "aliases": ["nuclear"]},
"2623": {"canonical_name": "biohazard", "aliases": []},
"1f4f4": {"canonical_name": "phone_off", "aliases": []},
"1f4f3": {"canonical_name": "vibration_mode", "aliases": []},
# '1f236': {'canonical_name': 'X', 'aliases': ['u6709']},
# '1f21a': {'canonical_name': 'X', 'aliases': ['u7121']},
# '1f238': {'canonical_name': 'X', 'aliases': ['u7533']},
# '1f23a': {'canonical_name': 'X', 'aliases': ['u55b6']},
# '1f237': {'canonical_name': 'X', 'aliases': ['u6708']},
# Japanese symbol. `canonical_name` taken from emojipedia.org.
"1f236": {"canonical_name": "japanese_not_free_of_charge_button", "aliases": ["u6709"]},
"1f250": {"canonical_name": "japanese_bargain_button", "aliases": ["ideograph_advantage"]},
"1f251": {"canonical_name": "japanese_acceptable_button", "aliases": ["accept"]},
"1f21a": {"canonical_name": "japanese_free_of_charge_button", "aliases": ["u7121"]},
"1f238": {"canonical_name": "japanese_application_button", "aliases": ["u7533"]},
"1f23a": {"canonical_name": "japanese_open_for_business_button", "aliases": ["u55b6"]},
"1f237": {"canonical_name": "japanese_monthly_amount_button", "aliases": ["u6708"]},
"3299": {"canonical_name": "japanese_secret_button", "aliases": ["secret"]},
"3297": {"canonical_name": "japanese_congratulations_button", "aliases": ["congratulations"]},
"1f234": {"canonical_name": "japanese_passing_grade_button", "aliases": ["u5408"]},
"1f235": {"canonical_name": "japanese_no_vacancy_button", "aliases": ["u6e80"]},
"1f239": {"canonical_name": "japanese_discount_button", "aliases": ["u5272"]},
"1f232": {"canonical_name": "japanese_prohibited_button", "aliases": ["u7981"]},
# End of Japanese symbol.
"2734": {"canonical_name": "eight_pointed_star", "aliases": []},
"1f19a": {"canonical_name": "vs", "aliases": []},
"1f4ae": {"canonical_name": "white_flower", "aliases": []},
# '1f250': {'canonical_name': 'X', 'aliases': ['ideograph_advantage']},
# japanese character
# '3299': {'canonical_name': 'X', 'aliases': ['secret']},
# '3297': {'canonical_name': 'X', 'aliases': ['congratulations']},
# '1f234': {'canonical_name': 'X', 'aliases': ['u5408']},
# '1f235': {'canonical_name': 'X', 'aliases': ['u6e80']},
# '1f239': {'canonical_name': 'X', 'aliases': ['u5272']},
# '1f232': {'canonical_name': 'X', 'aliases': ['u7981']},
"1f170": {"canonical_name": "a", "aliases": []},
"1f171": {"canonical_name": "b", "aliases": []},
"1f18e": {"canonical_name": "ab", "aliases": []},