Skip to content

Commit

Permalink
emoji: Finish script to generate emoji_names.py with CLDR data.
Browse files Browse the repository at this point in the history
This script pulls from our previously custom-written emoji strings
and fills in the rest from CLDR. It also removes 4 custom emoji which
collide with some of the new CLDR names (they will now just be called
by their CLDR name).
  • Loading branch information
evykassirer authored and timabbott committed Oct 4, 2022
1 parent 44df15e commit 8a9e68e
Show file tree
Hide file tree
Showing 7 changed files with 1,100 additions and 34 deletions.
20 changes: 10 additions & 10 deletions frontend_tests/node_tests/emoji_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, 1052);
assert.equal(emoji.emojis_by_name.size, 1817);

let total_emoji_in_categories = 0;

Expand All @@ -42,17 +42,17 @@ 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", 197);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-smile-o", 129);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-car", 195);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-hashtag", 221);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-smile-o", 162);
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);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-lightbulb-o", 189);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-cutlery", 92);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-flag", 5);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-thumbs-o-up", 353);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-lightbulb-o", 255);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-cutlery", 132);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-flag", 268);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-cog", 1);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-leaf", 104);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-soccer-ball-o", 63);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-leaf", 144);
assert_emoji_category(complete_emoji_catalog.pop(), "fa-soccer-ball-o", 86);

// The popular emoji appear twice in the picker, and the zulip emoji is special
assert.equal(
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
"@typescript-eslint/parser": "^5.0.0",
"babel-plugin-rewire-ts": "^1.4.0",
"callsites": "^3.1.0",
"cldr-annotations-derived-modern": "^41.0.0",
"cldr-annotations-modern": "^41.0.0",
"diff": "^5.0.0",
"difflib": "^0.2.4",
"enhanced-resolve": "^5.8.2",
Expand Down
9 changes: 0 additions & 9 deletions tools/setup/emoji/custom_emoji_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"1f60d": {"canonical_name": "heart_eyes", "aliases": ["in_love"]},
# blow_a_kiss from https://beebom.com/emoji-meanings/
"1f618": {"canonical_name": "heart_kiss", "aliases": ["blow_a_kiss"]},
"1f617": {"canonical_name": "kiss", "aliases": []},
"1f619": {"canonical_name": "kiss_smiling_eyes", "aliases": []},
"1f61a": {"canonical_name": "kiss_with_blush", "aliases": []},
"1f60b": {"canonical_name": "yum", "aliases": []},
Expand Down Expand Up @@ -411,10 +410,6 @@
# spiral_shell from Unicode/gemoji, the others seemed like reasonable
# additions
"1f41a": {"canonical_name": "shell", "aliases": ["seashell", "conch", "spiral_shell"]},
# Unicode/gemoji have lady_beetle; hopefully with ladybug we get both the
# people that prefer lady_beetle (with beetle) and ladybug. There is also
# ladybird, but seems a bit much for this to complete for bird.
"1f41e": {"canonical_name": "beetle", "aliases": ["ladybug"]},
"1f41c": {"canonical_name": "ant", "aliases": []},
"1f577": {"canonical_name": "spider", "aliases": []},
"1f578": {"canonical_name": "web", "aliases": ["spider_web"]},
Expand Down Expand Up @@ -738,8 +733,6 @@
"1f945": {"canonical_name": "gooooooooal", "aliases": ["goal"]},
"1f3d2": {"canonical_name": "ice_hockey", "aliases": []},
"1f3d1": {"canonical_name": "field_hockey", "aliases": []},
# would say bat, but taken by Nature/30
"1f3cf": {"canonical_name": "cricket", "aliases": ["cricket_bat"]},
# hole_in_one seems like a more useful name to have. Sent golf to
# Activity/39
"26f3": {"canonical_name": "hole_in_one", "aliases": []},
Expand Down Expand Up @@ -1210,8 +1203,6 @@
"1f4ee": {"canonical_name": "mail_dropoff", "aliases": []},
"1f4ef": {"canonical_name": "horn", "aliases": []},
"1f4dc": {"canonical_name": "scroll", "aliases": []},
# receipt seems more useful?
"1f4c3": {"canonical_name": "receipt", "aliases": []},
"1f4c4": {"canonical_name": "document", "aliases": ["paper", "file", "page"]},
"1f4d1": {"canonical_name": "place_holder", "aliases": []},
"1f4ca": {"canonical_name": "bar_chart", "aliases": []},
Expand Down
Loading

0 comments on commit 8a9e68e

Please sign in to comment.