Use shared emoji catalog

This commit is contained in:
Storm Dragon committed 2026-11-11 23:47:45 -05:00
1 parent e6da76e14a
commit f4226e705f
13 files changed
+3405 -3766

No files matched your search

+8
View File
@@ -22,6 +22,14 @@ assets. `internal/i18n/locale/` holds translations. `docs/` contains manuals;
`tools/` contains maintenance utilities. `src/fenrirscreenreader/` retains Python
sources, while `tests/` includes Python unit, integration, and native fixtures.
Reader-independent Go code shared with Cthulhu lives in
`git.stormux.org/storm/screenreader-common`; check it before duplicating pure
data or behavior. The emoji catalog is shared there. Keep Fenrir's picker form,
console/X11 input, clipboard action, and translations here. For shared changes,
test the common package, tag a version, and update the pinned module in
`go.mod`; keep local `go.work` or `replace` paths out of commits. New shared
labels also require `go run ./tools/translations update` and `check`.
## Build, Test, and Development Commands
Use Linux, Go 1.27.2 or newer, a C compiler, and `pkg-config`, with development
+1
View File
@@ -3,6 +3,7 @@ module git.stormux.org/storm/fenrir
go 1.27.2
require (
git.stormux.org/storm/screenreader-common v0.1.1
github.com/jfreymuth/pulse v0.1.3
github.com/leonelquinteros/gotext v1.8.0
github.com/pelletier/go-toml/v2 v2.4.3
+2
View File
@@ -1,3 +1,5 @@
git.stormux.org/storm/screenreader-common v0.1.1 h1:r/qcWUv4ODZ+XzXw1J+qe4hVnyr7MqH0W7L5tp6XOcE=
git.stormux.org/storm/screenreader-common v0.1.1/go.mod h1:iLmD0KXRvR4ar3U80JMwbaNUOyR82/gY7xHUY+zeIoY=
github.com/jfreymuth/pulse v0.1.3 h1:bc5TdxiB8E+2INnFjFWWgyfgXtz2IyNNNCX+Wt/ZD14=
github.com/jfreymuth/pulse v0.1.3/go.mod h1:cpYspI6YljhkUf1WLXLLDmeaaPFc3CnGLjDZf9dZ4no=
github.com/leonelquinteros/gotext v1.8.0 h1:wwpxINWmWq3JN3WFI9BoSupBFrvAqxZTtf3qppijYkU=
+14 -535
View File
@@ -2,562 +2,41 @@
// Copyright (c) 2026 Storm Dragon
// SPDX-License-Identifier: GPL-3.0-or-later
// Package emoji provides the bundled picker catalog and its internal UI form.
// Package emoji adapts the shared catalog to Fenrir's internal UI form.
package emoji
import (
"sort"
"git.stormux.org/storm/fenrir/internal/interaction"
commonemoji "git.stormux.org/storm/screenreader-common/emoji"
)
const MenuTitle = "Emoji Menu"
// Catalog values originate in Python Fenrir commands/vmenu-profiles/KEY/emoji.
// Duplicate aliases are omitted; names describe the stored Unicode sequence.
var categories = []struct {
id, label string
choices []interaction.Choice
}{
{"people", "People", []interaction.Choice{
{ID: "😠", Label: "Angry"},
{ID: "😁", Label: "Beaming"},
{ID: "😘", Label: "Blowing kiss"},
{ID: "😎", Label: "Cool"},
{ID: "😭", Label: "Crying"},
{ID: "😈", Label: "Devil"},
{ID: "😵", Label: "Dizzy"},
{ID: "🦵", Label: "Leg"},
{ID: "🧑‍🚀", Label: "Astronaut"},
{ID: "🤯", Label: "Exploding head"},
{ID: "🤬", Label: "Face with symbols"},
{ID: "😀", Label: "Grinning"},
{ID: "😅", Label: "Grinning sweat"},
{ID: "😍", Label: "Heart eyes"},
{ID: "🥰", Label: "Hearts around"},
{ID: "👿", Label: "Imp"},
{ID: "😂", Label: "Laughing"},
{ID: "🤢", Label: "Nauseated"},
{ID: "🥺", Label: "Pleading"},
{ID: "💩", Label: "Poop"},
{ID: "🤣", Label: "Rolling laughing"},
{ID: "😢", Label: "Sad"},
{ID: "😋", Label: "Savoring food"},
{ID: "😱", Label: "Screaming"},
{ID: "😊", Label: "Smiling"},
{ID: "😏", Label: "Smirking"},
{ID: "🤩", Label: "Star-struck"},
{ID: "👍", Label: "Thumbs up"},
{ID: "😉", Label: "Winking"},
{ID: "🧑‍💻", Label: "Technologist"},
{ID: "🥳", Label: "Partying face"},
{ID: "🤔", Label: "Thinking face"},
{ID: "🫠", Label: "Melting face"},
{ID: "🥲", Label: "Smiling face with tear"},
{ID: "🤠", Label: "Cowboy hat face"},
{ID: "🥱", Label: "Yawning face"},
{ID: "🫡", Label: "Saluting face"},
{ID: "🤝", Label: "Handshake"},
{ID: "👏", Label: "Clapping hands"},
{ID: "🙌", Label: "Raising hands"},
{ID: "🫶", Label: "Heart hands"},
{ID: "👌", Label: "OK hand"},
{ID: "👎", Label: "Thumbs down"},
{ID: "💪", Label: "Flexed biceps"},
{ID: "🦶", Label: "Foot"},
{ID: "👶", Label: "Baby"},
{ID: "👽", Label: "Alien"},
{ID: "👼", Label: "Baby Angel"},
{ID: "👈", Label: "Backhand Index Pointing Left"},
{ID: "👉", Label: "Backhand Index Pointing Right"},
{ID: "🤙", Label: "Call Me Hand"},
{ID: "🤡", Label: "Clown Face"},
{ID: "🤞", Label: "Crossed Fingers"},
{ID: "🧝", Label: "Elf"},
{ID: "🧐", Label: "Face With Monocle"},
{ID: "😛", Label: "Face With Tongue"},
{ID: "🧚", Label: "Fairy"},
{ID: "🧞", Label: "Genie"},
{ID: "👻", Label: "Ghost"},
{ID: "👺", Label: "Goblin"},
{ID: "😃", Label: "Grinning Face With Big Eyes"},
{ID: "😄", Label: "Grinning Face With Smiling Eyes"},
{ID: "🤟", Label: "Love You Gesture"},
{ID: "🧙", Label: "Mage"},
{ID: "🧜", Label: "Merperson"},
{ID: "🤶", Label: "Mrs. Claus"},
{ID: "🤓", Label: "Nerd Face"},
{ID: "👹", Label: "Ogre"},
{ID: "🤌", Label: "Pinched Fingers"},
{ID: "🤏", Label: "Pinching Hand"},
{ID: "🤚", Label: "Raised Back Of Hand"},
{ID: "✋", Label: "Raised Hand"},
{ID: "🤖", Label: "Robot"},
{ID: "🙂", Label: "Slightly Smiling Face"},
{ID: "😇", Label: "Smiling Face With Halo"},
{ID: "🦸", Label: "Superhero"},
{ID: "🦹", Label: "Supervillain"},
{ID: "🙃", Label: "Upside Down Face"},
{ID: "🧛", Label: "Vampire"},
{ID: "🖖", Label: "Vulcan Salute"},
{ID: "👋", Label: "Waving Hand"},
{ID: "🤪", Label: "Zany Face"},
{ID: "🧟", Label: "Zombie"},
{ID: "🤭", Label: "Face With Hand Over Mouth"},
{ID: "👂", Label: "Ear"},
{ID: "👃", Label: "Nose"},
{ID: "👣", Label: "Footprints"},
{ID: "👀", Label: "Eyes"},
{ID: "🧠", Label: "Brain"},
{ID: "🦷", Label: "Tooth"},
{ID: "🦾", Label: "Mechanical Arm"},
{ID: "🦿", Label: "Mechanical Leg"},
}},
{"nature", "Nature", []interaction.Choice{
{ID: "🦋", Label: "Butterfly"},
{ID: "🐱", Label: "Cat"},
{ID: "🌸", Label: "Cherry blossom"},
{ID: "🐶", Label: "Dog"},
{ID: "🌙", Label: "Moon"},
{ID: "🌈", Label: "Rainbow"},
{ID: "🌹", Label: "Rose"},
{ID: "☀️", Label: "Sun"},
{ID: "🌻", Label: "Sunflower"},
{ID: "🌳", Label: "Tree"},
{ID: "🐺", Label: "Wolf"},
{ID: "🐝", Label: "Bee"},
{ID: "🐞", Label: "Lady beetle"},
{ID: "🐢", Label: "Turtle"},
{ID: "🐍", Label: "Snake"},
{ID: "🐙", Label: "Octopus"},
{ID: "🐬", Label: "Dolphin"},
{ID: "🐳", Label: "Spouting whale"},
{ID: "🐠", Label: "Tropical fish"},
{ID: "🦈", Label: "Shark"},
{ID: "🐘", Label: "Elephant"},
{ID: "🦒", Label: "Giraffe"},
{ID: "🦓", Label: "Zebra"},
{ID: "🦌", Label: "Deer"},
{ID: "🐴", Label: "Horse face"},
{ID: "🐮", Label: "Cow face"},
{ID: "🐷", Label: "Pig face"},
{ID: "🐭", Label: "Mouse face"},
{ID: "🐹", Label: "Hamster"},
{ID: "🦊", Label: "Fox"},
{ID: "🐻", Label: "Bear"},
{ID: "🦡", Label: "Badger"},
{ID: "🦇", Label: "Bat"},
{ID: "🦫", Label: "Beaver"},
{ID: "🐗", Label: "Boar"},
{ID: "🐪", Label: "Camel"},
{ID: "🐿️", Label: "Chipmunk"},
{ID: "🐄", Label: "Cow"},
{ID: "🐕", Label: "Dog"},
{ID: "🐑", Label: "Ewe"},
{ID: "🐐", Label: "Goat"},
{ID: "🦍", Label: "Gorilla"},
{ID: "🦮", Label: "Guide Dog"},
{ID: "🦔", Label: "Hedgehog"},
{ID: "🦛", Label: "Hippopotamus"},
{ID: "🦘", Label: "Kangaroo"},
{ID: "🐨", Label: "Koala"},
{ID: "🐆", Label: "Leopard"},
{ID: "🦁", Label: "Lion"},
{ID: "🦙", Label: "Llama"},
{ID: "🐵", Label: "Monkey Face"},
{ID: "🦧", Label: "Orangutan"},
{ID: "🦦", Label: "Otter"},
{ID: "🐂", Label: "Ox"},
{ID: "🐼", Label: "Panda"},
{ID: "🐾", Label: "Paw Prints"},
{ID: "🐩", Label: "Poodle"},
{ID: "🦝", Label: "Raccoon"},
{ID: "🐏", Label: "Ram"},
{ID: "🐀", Label: "Rat"},
{ID: "🦏", Label: "Rhinoceros"},
{ID: "🐕‍🦺", Label: "Service Dog"},
{ID: "🦨", Label: "Skunk"},
{ID: "🦥", Label: "Sloth"},
{ID: "🐯", Label: "Tiger Face"},
{ID: "🦄", Label: "Unicorn"},
{ID: "🐃", Label: "Water Buffalo"},
{ID: "🦢", Label: "Swan"},
{ID: "🦉", Label: "Owl"},
{ID: "🦚", Label: "Peacock"},
{ID: "🦜", Label: "Parrot"},
{ID: "🕊️", Label: "Dove"},
{ID: "🦅", Label: "Eagle"},
{ID: "🦆", Label: "Duck"},
{ID: "🐸", Label: "Frog"},
{ID: "🐊", Label: "Crocodile"},
{ID: "🦎", Label: "Lizard"},
{ID: "🐲", Label: "Dragon Face"},
{ID: "🐉", Label: "Dragon"},
{ID: "🐋", Label: "Whale"},
{ID: "🐟", Label: "Fish"},
{ID: "🐡", Label: "Blowfish"},
{ID: "🐌", Label: "Snail"},
{ID: "🐛", Label: "Bug"},
{ID: "🐜", Label: "Ant"},
{ID: "🪲", Label: "Beetle"},
{ID: "🦗", Label: "Cricket"},
{ID: "🦂", Label: "Scorpion"},
{ID: "🦟", Label: "Mosquito"},
{ID: "🦠", Label: "Microbe"},
{ID: "💐", Label: "Bouquet"},
{ID: "💮", Label: "White Flower"},
{ID: "🏵️", Label: "Rosette"},
{ID: "🥀", Label: "Wilted Flower"},
{ID: "🌺", Label: "Hibiscus"},
{ID: "🌼", Label: "Blossom"},
{ID: "🌷", Label: "Tulip"},
{ID: "🌱", Label: "Seedling"},
{ID: "🌲", Label: "Evergreen Tree"},
{ID: "🌴", Label: "Palm Tree"},
{ID: "🌵", Label: "Cactus"},
{ID: "🌾", Label: "Sheaf Of Rice"},
{ID: "🌿", Label: "Herb"},
{ID: "🍀", Label: "Four Leaf Clover"},
{ID: "🍁", Label: "Maple Leaf"},
{ID: "🍂", Label: "Fallen Leaf"},
{ID: "🍃", Label: "Leaf Fluttering In Wind"},
{ID: "🍄", Label: "Mushroom"},
{ID: "🌰", Label: "Chestnut"},
{ID: "🌑", Label: "New Moon"},
{ID: "🌔", Label: "Waxing Gibbous Moon"},
{ID: "🌕", Label: "Full Moon"},
{ID: "🌞", Label: "Sun With Face"},
{ID: "☁️", Label: "Cloud"},
{ID: "🌪️", Label: "Tornado"},
{ID: "🌬️", Label: "Wind Face"},
{ID: "☔", Label: "Umbrella With Rain Drops"},
{ID: "❄️", Label: "Snowflake"},
{ID: "☄️", Label: "Comet"},
{ID: "💧", Label: "Droplet"},
{ID: "🌊", Label: "Water Wave"},
}},
{"food", "Food", []interaction.Choice{
{ID: "🍎", Label: "Apple"},
{ID: "🥑", Label: "Avocado"},
{ID: "🍺", Label: "Beer"},
{ID: "🎂", Label: "Birthday cake"},
{ID: "☕", Label: "Coffee"},
{ID: "🍩", Label: "Donut"},
{ID: "🍔", Label: "Hamburger"},
{ID: "🍕", Label: "Pizza"},
{ID: "🍓", Label: "Strawberry"},
{ID: "🌮", Label: "Taco"},
{ID: "🍐", Label: "Pear"},
{ID: "🍊", Label: "Tangerine"},
{ID: "🍋", Label: "Lemon"},
{ID: "🍌", Label: "Banana"},
{ID: "🍉", Label: "Watermelon"},
{ID: "🍇", Label: "Grapes"},
{ID: "🍒", Label: "Cherries"},
{ID: "🍑", Label: "Peach"},
{ID: "🥭", Label: "Mango"},
{ID: "🍍", Label: "Pineapple"},
{ID: "🥥", Label: "Coconut"},
{ID: "🥝", Label: "Kiwi fruit"},
{ID: "🍅", Label: "Tomato"},
{ID: "🥕", Label: "Carrot"},
{ID: "🌽", Label: "Corn"},
{ID: "🥔", Label: "Potato"},
{ID: "🍞", Label: "Bread"},
{ID: "🥐", Label: "Croissant"},
{ID: "🥞", Label: "Pancakes"},
{ID: "🧀", Label: "Cheese"},
{ID: "🥖", Label: "Baguette Bread"},
{ID: "🍱", Label: "Bento Box"},
{ID: "🫐", Label: "Blueberries"},
{ID: "🥦", Label: "Broccoli"},
{ID: "🧈", Label: "Butter"},
{ID: "🥫", Label: "Canned Food"},
{ID: "🍛", Label: "Curry Rice"},
{ID: "🍡", Label: "Dango"},
{ID: "🥟", Label: "Dumpling"},
{ID: "🍆", Label: "Eggplant"},
{ID: "🥠", Label: "Fortune Cookie"},
{ID: "🍤", Label: "Fried Shrimp"},
{ID: "🍏", Label: "Green Apple"},
{ID: "🥗", Label: "Green Salad"},
{ID: "🦞", Label: "Lobster"},
{ID: "🥮", Label: "Moon Cake"},
{ID: "🍢", Label: "Oden"},
{ID: "🦪", Label: "Oyster"},
{ID: "🍿", Label: "Popcorn"},
{ID: "🥨", Label: "Pretzel"},
{ID: "🍙", Label: "Rice Ball"},
{ID: "🍘", Label: "Rice Cracker"},
{ID: "🍠", Label: "Roasted Sweet Potato"},
{ID: "🧂", Label: "Salt"},
{ID: "🍝", Label: "Spaghetti"},
{ID: "🍜", Label: "Steaming Bowl"},
{ID: "🍣", Label: "Sushi"},
{ID: "🥡", Label: "Takeout Box"},
{ID: "🥯", Label: "Bagel"},
{ID: "🧇", Label: "Waffle"},
{ID: "🥘", Label: "Shallow Pan Of Food"},
{ID: "🫕", Label: "Fondue"},
{ID: "🍨", Label: "Ice Cream"},
{ID: "🍧", Label: "Shaved Ice"},
{ID: "🍪", Label: "Cookie"},
{ID: "🧁", Label: "Cupcake"},
{ID: "🥧", Label: "Pie"},
{ID: "🍫", Label: "Chocolate Bar"},
{ID: "🍬", Label: "Candy"},
{ID: "🍭", Label: "Lollipop"},
{ID: "🍮", Label: "Custard"},
{ID: "🍯", Label: "Honey Pot"},
{ID: "🍼", Label: "Baby Bottle"},
{ID: "🥛", Label: "Glass Of Milk"},
{ID: "🍶", Label: "Sake"},
{ID: "🍷", Label: "Wine Glass"},
{ID: "🍸", Label: "Cocktail Glass"},
{ID: "🍹", Label: "Tropical Drink"},
{ID: "🥂", Label: "Clinking Glasses"},
{ID: "🥃", Label: "Tumbler Glass"},
{ID: "🥤", Label: "Cup With Straw"},
}},
{"activity", "Activity", []interaction.Choice{
{ID: "⚽", Label: "Soccer ball"},
{ID: "🏀", Label: "Basketball"},
{ID: "🏈", Label: "American football"},
{ID: "⚾", Label: "Baseball"},
{ID: "🎾", Label: "Tennis ball"},
{ID: "🏐", Label: "Volleyball"},
{ID: "🥏", Label: "Flying disc"},
{ID: "🏉", Label: "Rugby football"},
{ID: "🎱", Label: "Pool 8 ball"},
{ID: "🏓", Label: "Table tennis"},
{ID: "🏸", Label: "Badminton"},
{ID: "🏒", Label: "Ice hockey"},
{ID: "🥅", Label: "Goal net"},
{ID: "🥍", Label: "Lacrosse"},
{ID: "🏏", Label: "Cricket game"},
{ID: "🛹", Label: "Skateboard"},
{ID: "🛷", Label: "Sled"},
{ID: "🏆", Label: "Trophy"},
{ID: "🎮", Label: "Video game"},
{ID: "🎯", Label: "Direct hit"},
{ID: "🥇", Label: "1st Place Medal"},
{ID: "🥈", Label: "2nd Place Medal"},
{ID: "🥉", Label: "3rd Place Medal"},
{ID: "🥌", Label: "Curling Stone"},
{ID: "🤿", Label: "Diving Mask"},
{ID: "🎣", Label: "Fishing Pole"},
{ID: "⛸️", Label: "Ice Skate"},
{ID: "🪁", Label: "Kite"},
{ID: "🏌️", Label: "Person Golfing"},
{ID: "🏄", Label: "Person Surfing"},
{ID: "🏊", Label: "Person Swimming"},
{ID: "🛼", Label: "Roller Skate"},
{ID: "🎽", Label: "Running Shirt"},
{ID: "⛷️", Label: "Skier"},
{ID: "🎿", Label: "Skis"},
{ID: "🏔️", Label: "Snow Capped Mountain"},
{ID: "🏂", Label: "Snowboarder"},
{ID: "🏅", Label: "Sports Medal"},
}},
{"travel", "Travel", []interaction.Choice{
{ID: "🚗", Label: "Automobile"},
{ID: "🚌", Label: "Bus"},
{ID: "🚕", Label: "Taxi"},
{ID: "🚓", Label: "Police car"},
{ID: "🚑", Label: "Ambulance"},
{ID: "🚒", Label: "Fire engine"},
{ID: "🚲", Label: "Bicycle"},
{ID: "🚀", Label: "Rocket"},
{ID: "✈️", Label: "Airplane"},
{ID: "⚓", Label: "Anchor"},
{ID: "🛫", Label: "Airplane Departure"},
{ID: "🛺", Label: "Auto Rickshaw"},
{ID: "🛶", Label: "Canoe"},
{ID: "🚧", Label: "Construction"},
{ID: "🚁", Label: "Helicopter"},
{ID: "🛴", Label: "Kick Scooter"},
{ID: "🚈", Label: "Light Rail"},
{ID: "🚐", Label: "Minibus"},
{ID: "🚝", Label: "Monorail"},
{ID: "🏍️", Label: "Motorcycle"},
{ID: "🚍", Label: "Oncoming Bus"},
{ID: "🛻", Label: "Pickup Truck"},
{ID: "🚃", Label: "Railway Car"},
{ID: "⛵", Label: "Sailboat"},
{ID: "🚢", Label: "Ship"},
{ID: "🛩️", Label: "Small Airplane"},
{ID: "🚤", Label: "Speedboat"},
{ID: "🚉", Label: "Station"},
{ID: "🚜", Label: "Tractor"},
{ID: "🚆", Label: "Train"},
{ID: "🚎", Label: "Trolleybus"},
}},
{"objects", "Objects", []interaction.Choice{
{ID: "⌚", Label: "Watch"},
{ID: "📱", Label: "Mobile phone"},
{ID: "💻", Label: "Laptop"},
{ID: "🖥️", Label: "Desktop computer"},
{ID: "🖨️", Label: "Printer"},
{ID: "⌨️", Label: "Keyboard"},
{ID: "🖱️", Label: "Computer mouse"},
{ID: "💾", Label: "Floppy disk"},
{ID: "💿", Label: "Optical disk"},
{ID: "🎥", Label: "Movie camera"},
{ID: "🧮", Label: "Abacus"},
{ID: "🪗", Label: "Accordion"},
{ID: "🪕", Label: "Banjo"},
{ID: "🔋", Label: "Battery"},
{ID: "📷", Label: "Camera"},
{ID: "📸", Label: "Camera With Flash"},
{ID: "🕯️", Label: "Candle"},
{ID: "🎬", Label: "Clapper Board"},
{ID: "🪔", Label: "Diya Lamp"},
{ID: "🥁", Label: "Drum"},
{ID: "📀", Label: "Dvd"},
{ID: "🔌", Label: "Electric Plug"},
{ID: "📽️", Label: "Film Projector"},
{ID: "🧯", Label: "Fire Extinguisher"},
{ID: "🔦", Label: "Flashlight"},
{ID: "🎸", Label: "Guitar"},
{ID: "🎧", Label: "Headphone"},
{ID: "💡", Label: "Light Bulb"},
{ID: "🪘", Label: "Long Drum"},
{ID: "🎤", Label: "Microphone"},
{ID: "🎹", Label: "Musical Keyboard"},
{ID: "🎼", Label: "Musical Score"},
{ID: "🛢️", Label: "Oil Drum"},
{ID: "📻", Label: "Radio"},
{ID: "🎷", Label: "Saxophone"},
{ID: "🛍️", Label: "Shopping Bags"},
{ID: "🛒", Label: "Shopping Cart"},
{ID: "☎️", Label: "Telephone"},
{ID: "📺", Label: "Television"},
{ID: "🎺", Label: "Trumpet"},
{ID: "📹", Label: "Video Camera"},
{ID: "🎻", Label: "Violin"},
{ID: "👓", Label: "Glasses"},
{ID: "🕶️", Label: "Sunglasses"},
{ID: "🥽", Label: "Goggles"},
{ID: "🥼", Label: "Lab Coat"},
{ID: "🦺", Label: "Safety Vest"},
{ID: "👔", Label: "Necktie"},
{ID: "👖", Label: "Jeans"},
{ID: "🧣", Label: "Scarf"},
{ID: "🧤", Label: "Gloves"},
{ID: "🧥", Label: "Coat"},
{ID: "🧦", Label: "Socks"},
{ID: "🥾", Label: "Hiking Boot"},
}},
{"holidays", "Holidays", []interaction.Choice{
{ID: "👾", Label: "Alien monster"},
{ID: "🐈‍⬛", Label: "Black cat"},
{ID: "🐰", Label: "Bunny"},
{ID: "🎄", Label: "Christmas tree"},
{ID: "⚰️", Label: "Coffin"},
{ID: "🥚", Label: "Egg"},
{ID: "🎆", Label: "Fireworks"},
{ID: "🎁", Label: "Gift"},
{ID: "🎃", Label: "Jack o'lantern"},
{ID: "🎅", Label: "Santa"},
{ID: "☘️", Label: "Shamrock"},
{ID: "💀", Label: "Skull"},
{ID: "⛄", Label: "Snowman"},
{ID: "🕷", Label: "Spider"},
{ID: "🦃", Label: "Turkey"},
{ID: "🕸️", Label: "Web"},
{ID: "🧙‍♀️", Label: "Witch"},
{ID: "🧨", Label: "Firecracker"},
{ID: "🎊", Label: "Confetti ball"},
{ID: "🎉", Label: "Party popper"},
{ID: "🎈", Label: "Balloon"},
{ID: "🎀", Label: "Ribbon"},
{ID: "🪄", Label: "Magic wand"},
{ID: "🔮", Label: "Crystal ball"},
{ID: "🪅", Label: "Piñata"},
{ID: "🪦", Label: "Headstone"},
}},
{"symbols", "Symbols", []interaction.Choice{
{ID: "🦴", Label: "Bone"},
{ID: "⛓️", Label: "Chains"},
{ID: "✅", Label: "Checkmark"},
{ID: "🗡️", Label: "Dagger"},
{ID: "🔥", Label: "Fire"},
{ID: "🙏", Label: "Folded hands"},
{ID: "❤️", Label: "Heart"},
{ID: "⚡", Label: "High voltage"},
{ID: "💯", Label: "Hundred points"},
{ID: "✌️", Label: "Peace"},
{ID: "🤘", Label: "Rock on"},
{ID: "☠️", Label: "Skull crossbones"},
{ID: "✨", Label: "Sparkles"},
{ID: "⭐", Label: "Star"},
{ID: "⚔️", Label: "Sword"},
{ID: "💔", Label: "Broken heart"},
{ID: "❤️‍🔥", Label: "Heart on fire"},
{ID: "❤️‍🩹", Label: "Mending heart"},
{ID: "💛", Label: "Yellow heart"},
{ID: "💚", Label: "Green heart"},
{ID: "💙", Label: "Blue heart"},
{ID: "💜", Label: "Purple heart"},
{ID: "🖤", Label: "Black heart"},
{ID: "🤎", Label: "Brown heart"},
{ID: "🤍", Label: "White heart"},
{ID: "🧡", Label: "Orange Heart"},
{ID: "🩷", Label: "Pink Heart"},
}},
{"flags", "Flags", []interaction.Choice{
{ID: "🇦🇷", Label: "Argentina"},
{ID: "🇦🇺", Label: "Australia"},
{ID: "🇧🇪", Label: "Belgium"},
{ID: "🇧🇷", Label: "Brazil"},
{ID: "🇨🇦", Label: "Canada"},
{ID: "🇨🇳", Label: "China"},
{ID: "🇩🇰", Label: "Denmark"},
{ID: "🇫🇮", Label: "Finland"},
{ID: "🇫🇷", Label: "France"},
{ID: "🇩🇪", Label: "Germany"},
{ID: "🇬🇷", Label: "Greece"},
{ID: "🇮🇳", Label: "India"},
{ID: "🇮🇪", Label: "Ireland"},
{ID: "🇮🇱", Label: "Israel"},
{ID: "🇮🇹", Label: "Italy"},
{ID: "🇯🇵", Label: "Japan"},
{ID: "🇲🇽", Label: "Mexico"},
{ID: "🇳🇱", Label: "Netherlands"},
{ID: "🇳🇴", Label: "Norway"},
{ID: "🇵🇱", Label: "Poland"},
{ID: "🇵🇹", Label: "Portugal"},
{ID: "🇷🇺", Label: "Russia"},
{ID: "🇿🇦", Label: "South Africa"},
{ID: "🇰🇷", Label: "South Korea"},
{ID: "🇪🇸", Label: "Spain"},
{ID: "🇸🇪", Label: "Sweden"},
{ID: "🇨🇭", Label: "Switzerland"},
{ID: "🇹🇷", Label: "Turkey"},
{ID: "🇺🇦", Label: "Ukraine"},
{ID: "🇬🇧", Label: "United Kingdom"},
{ID: "🇺🇸", Label: "United States"},
}},
}
// New_session builds an independent draft. Search is local to each category;
// the first All tab searches the complete catalog.
func New_session() (*interaction.Session, error) {
form := interaction.Form{Type: interaction.TabForm, Title: MenuTitle}
var all []interaction.Choice
for _, category := range categories {
all = append(all, category.choices...)
}
sort.SliceStable(all, func(i, j int) bool { return all[i].Label < all[j].Label })
sharedCategories := commonemoji.Categories()
addTab := func(id, label string, choices []interaction.Choice) {
form.Tabs = append(form.Tabs, interaction.Tab{ID: id, Label: label, Controls: []interaction.Control{{
ID: "emoji", Label: "Emoji", Kind: interaction.Grid, Choices: choices, Columns: 6, Action: "copy_emoji",
}}})
}
addTab("all", "All", all)
for _, category := range categories {
addTab(category.id, category.label, category.choices)
for _, category := range sharedCategories {
choices := make([]interaction.Choice, len(category.Entries))
for index, entry := range category.Entries {
choices[index] = interaction.Choice{ID: entry.ID, Label: entry.Label}
}
all = append(all, choices...)
addTab(category.ID, category.Label, choices)
}
sort.SliceStable(all, func(i, j int) bool { return all[i].Label < all[j].Label })
form.Tabs = append([]interaction.Tab{{ID: "all", Label: "All", Controls: []interaction.Control{{
ID: "emoji", Label: "Emoji", Kind: interaction.Grid, Choices: all, Columns: 6, Action: "copy_emoji",
}}}}, form.Tabs...)
return interaction.New_session(form)
}
+32 -8
View File
@@ -10,6 +10,7 @@ import (
"git.stormux.org/storm/fenrir/internal/i18n"
"git.stormux.org/storm/fenrir/internal/interaction"
commonemoji "git.stormux.org/storm/screenreader-common/emoji"
)
func TestCategorySelectionAndIndependentSearches(t *testing.T) {
@@ -79,14 +80,14 @@ func TestExpandedCatalogCategoriesAndUniqueEmojiIDs(t *testing.T) {
emojiIDs := make(map[string]bool)
presentationIDs := make(map[string]string)
stripPresentation := strings.NewReplacer("\ufe0e", "", "\ufe0f", "")
for _, category := range categories {
if _, ok := expectedCategories[category.id]; ok {
expectedCategories[category.id] = true
for _, category := range commonemoji.Categories() {
if _, ok := expectedCategories[category.ID]; ok {
expectedCategories[category.ID] = true
}
if category.id == "" || category.label == "" || len(category.choices) == 0 {
if category.ID == "" || category.Label == "" || len(category.Entries) == 0 {
t.Fatalf("invalid category %#v", category)
}
for _, choice := range category.choices {
for _, choice := range category.Entries {
if choice.ID == "" || choice.Label == "" {
t.Fatalf("invalid choice %#v", choice)
}
@@ -107,11 +108,34 @@ func TestExpandedCatalogCategoriesAndUniqueEmojiIDs(t *testing.T) {
t.Fatal("missing category", id)
}
}
if len(emojiIDs) != 501 {
if len(emojiIDs) != 506 {
t.Fatal("expanded catalog has the wrong size", len(emojiIDs))
}
if !emojiIDs["🐐"] || !emojiIDs["🎉"] {
t.Fatal("goat or party popper emoji missing")
if !emojiIDs["🐐"] || !emojiIDs["🎉"] || !emojiIDs["💋"] {
t.Fatal("expected emoji missing")
}
}
func TestKissMarkSearch(t *testing.T) {
session, err := New_session()
if err != nil {
t.Fatal(err)
}
session.Handle(interaction.Key{Name: "tab"})
session.Handle(interaction.Key{Text: "Kiss mark"})
if value, label, ok := Selection(session); !ok || value != "💋" || label != "Kiss mark" {
t.Fatalf("kiss mark selection = %q %q %v", value, label, ok)
}
previous := i18n.Use(i18n.New(t.TempDir(), "de"))
t.Cleanup(func() { i18n.Use(previous) })
localized, err := New_session()
if err != nil {
t.Fatal(err)
}
localized.Handle(interaction.Key{Name: "tab"})
localized.Handle(interaction.Key{Text: "Kussabdruck"})
if value, _, ok := Selection(localized); !ok || value != "💋" {
t.Fatalf("localized kiss mark selection = %q %v", value, ok)
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-9
View File
@@ -56,15 +56,6 @@
"all"
],
"internal/emoji/catalog.go": [
"People",
"Nature",
"Food",
"Activity",
"Travel",
"Objects",
"Holidays",
"Symbols",
"Flags",
"All"
],
"internal/punctuation/text_processing.go": [
+9
View File
@@ -20,6 +20,7 @@ import (
"strconv"
"strings"
commonemoji "git.stormux.org/storm/screenreader-common/emoji"
"github.com/leonelquinteros/gotext"
"github.com/pelletier/go-toml/v2"
)
@@ -198,6 +199,14 @@ func extract() (map[string][]string, error) {
if err != nil {
return nil, err
}
// The picker data lives in screenreader-common, outside the reader's
// internal/ tree scanned above. Its English labels remain Fenrir message IDs.
for _, category := range commonemoji.Categories() {
add(category.Label, "screenreader-common/emoji/catalog.go")
for _, entry := range category.Entries {
add(entry.Label, "screenreader-common/emoji/catalog.go")
}
}
// Dynamic labels without a directly extractable lookup. Each must still
// occur in its source, so removals/renames cannot silently leave stale IDs.
data, err := os.ReadFile("tools/translations/dynamic.json")