# -*- coding: utf-8 -*-
"""Vocabulary of «Le chat Mistou 2 – 1re partie» (SABIS, Grade 2).
key -> dict(fr, art, ar, emoji, desc, img): fr = word as in the book (no article); art = article;
ar = Arabic meaning; emoji = fallback picture; desc = English description for image generation;
img = True when a generated picture is wanted at static/vocab/<key>.png
"""

W = {}


def add(key, fr, art, ar, emoji, desc="", img=True, **extra):
    d = dict(key=key, fr=fr, art=art, ar=ar, emoji=emoji, desc=desc or fr, img=img)
    d.update(extra)
    W[key] = d
    return d


# ------------------------------------------------ Unit 1 : letters A-Z (book pages 14-112)
LETTERS = [
    ("a", [("ami", "ami", "Un", "صديق", "🧑‍🤝‍🧑", "two smiling eight-year-old children, friends, standing side by side"),
           ("ananas", "ananas", "Un", "أناناس", "🍍", "a whole pineapple")], "Anna", "👧"),
    ("b", [("banane", "banane", "Une", "موزة", "🍌", "a yellow banana"),
           ("bol", "bol", "Un", "سلطانية / طبق عميق", "🥣", "a blue ceramic bowl")], "Bob", "👦"),
    ("c", [("cle", "clé", "Une", "مفتاح", "🔑", "a golden door key"),
           ("cube", "cube", "Un", "مكعب", "🧊", "a colourful wooden toy cube block")], "Carla", "👧"),
    ("d", [("datte", "datte", "Une", "تمرة", "🌴", "a few brown dates (the fruit) on a small plate"),
           ("de", "dé", "Un", "زهر / نرد", "🎲", "a white dice showing six dots")], "David", "👦"),
    ("e", [("menu", "menu", "Un", "قائمة الطعام", "📋", "a restaurant menu card held open"),
           ("regarde", "regarde", "Il", "هو ينظر", "👀", "an eight-year-old boy looking carefully through a magnifying glass")], "René", "👦"),
    ("f", [("farine", "farine", "La", "دقيق / طحين", "🌾", "a paper bag of flour with a small heap of white flour"),
           ("cafe", "café", "Le", "قهوة", "☕", "a cup of hot coffee")], "Frida", "👧"),
    ("g", [("garde", "garde", "Un", "حارس", "💂", "a friendly palace guard in a red uniform"),
           ("gomme", "gomme", "Une", "ممحاة", "🩹", "a pink school eraser")], "Galina", "👧"),
    ("h", [("homme", "homme", "Un", "رجل", "👨", "a smiling man standing"),
           ("huit", "huit", "Le", "ثمانية (8)", "8️⃣", "eight colourful balloons tied together")], "Hervé", "👦"),
    ("i", [("ile", "île", "Une", "جزيرة", "🏝️", "a small tropical island with one palm tree in the sea"),
           ("image", "image", "Une", "صورة", "🖼️", "a framed picture of a landscape hanging on a wall")], "Irène", "👧"),
    ("j", [("judo", "judo", "Le", "الجودو", "🤼", "two children in white judo suits practising judo"),
           ("jus", "jus", "Un", "عصير", "🧃", "a glass of orange juice with a straw")], "Jill", "👧"),
    ("k", [("kaki", "kaki", "Un", "كاكا (فاكهة)", "🟠", "an orange persimmon fruit (kaki) with a green leaf"),
           ("karate", "karaté", "Le", "الكاراتيه", "🥋", "a child in a white karate suit with a belt doing a kick")], "Kira", "👧"),
    ("l", [("lac", "lac", "Un", "بحيرة", "🏞️", "a calm blue lake with mountains and trees"),
           ("lavabo", "lavabo", "Un", "حوض الغسيل", "🚰", "a white bathroom washbasin with a tap")], "Luc", "👦"),
    ("m", [("moto", "moto", "Une", "دراجة نارية", "🏍️", "a red motorcycle"),
           ("mur", "mur", "Un", "جدار / حائط", "🧱", "a red brick wall")], "Marie", "👧"),
    ("n", [("nature", "nature", "La", "الطبيعة", "🌳", "green nature: trees, flowers, a river and a sunny sky"),
           ("nuage", "nuage", "Un", "سحابة", "☁️", "a fluffy white cloud in a blue sky")], "Nicole", "👧"),
    ("o", [("olive", "olive", "Une", "زيتونة", "🫒", "a few green olives with a leaf"),
           ("os", "os", "Un", "عظمة", "🦴", "a white dog bone")], "Oscar", "👦"),
    ("p", [("piano", "piano", "Un", "بيانو", "🎹", "a black grand piano"),
           ("porte", "porte", "Une", "باب", "🚪", "a wooden front door with a handle")], "Pamela", "👧"),
    ("q", [("coq", "coq", "Un", "ديك", "🐓", "a colourful rooster"),
           ("queue", "queue", "Une", "ذيل", "🐒", "a monkey with a long curly tail, the tail clearly visible")], "Quentin", "👦"),
    ("r", [("robe", "robe", "Une", "فستان", "👗", "a pretty red dress on a hanger"),
           ("rue", "rue", "Une", "شارع", "🛣️", "a quiet street with houses and a lamp post")], "Robin", "👦"),
    ("s", [("sac", "sac", "Un", "حقيبة", "🎒", "a school backpack"),
           ("salade", "salade", "Une", "سلطة", "🥗", "a bowl of green salad")], "Samia", "👧"),
    ("t", [("table", "table", "Une", "طاولة", "🪑", "a wooden table"),
           ("tomate", "tomate", "Une", "طماطم", "🍅", "a red tomato")], "Tom", "👦"),
    ("u", [("lune", "Lune", "La", "القمر", "🌙", "a crescent moon in a dark blue night sky with stars"),
           ("uniforme", "uniforme", "Un", "زي رسمي", "👮", "a school uniform: blue blazer, white shirt and tie, on a hanger")], "Ursula", "👧"),
    ("v", [("verre", "verre", "Un", "كوب زجاجي", "🥛", "a clear drinking glass of water"),
           ("vole", "vole", "Il", "هو يطير", "🐦", "a small bird flying with open wings")], "Victor", "👦"),
    ("w", [("kiwi", "kiwi", "Un", "كيوي", "🥝", "a kiwi fruit cut in half"),
           ("waterpolo", "waterpolo", "Le", "كرة الماء", "🤽", "children playing water polo in a swimming pool with a ball")], "Wendy", "👧"),
    ("x", [("boxe", "boxe", "La", "الملاكمة", "🥊", "a pair of red boxing gloves"),
           ("taxi", "taxi", "Un", "تاكسي", "🚕", "a yellow taxi car")], "Xavier", "👦"),
    ("y", [("yoga", "yoga", "Le", "اليوغا", "🧘", "a child sitting cross-legged doing yoga on a mat"),
           ("yoyo", "yoyo", "Un", "يويو", "🪀", "a red yo-yo toy with its string")], "Yasmina", "👧"),
    ("z", [("zebre", "zèbre", "Un", "حمار وحشي", "🦓", "a zebra"),
           ("zero", "zéro", "Le", "صفر (0)", "0️⃣", "a big round number zero drawn as a friendly blue ring")], "Zoé", "👧"),
]

for letter, words, name, name_emoji in LETTERS:
    for key, fr, art, ar, emoji, desc in words:
        add(key, fr, art, ar, emoji, desc, letter=letter)
    add("name_" + letter, name, "", "اسم " + ("بنت" if name_emoji == "👧" else "ولد"), name_emoji, img=False, letter=letter, is_name=True)

# «Je m'amuse» words: spot the letter in illustrated words (emoji only)
FUN = {
    "b": [("arbre", "شجرة", "🌳"), ("bonbon", "حلوى", "🍬"), ("bonnet", "قبعة صوف", "🧢"), ("bouteille", "زجاجة", "🍾"),
          ("ballon", "بالون", "🎈"), ("bougie", "شمعة", "🕯️"), ("robot", "روبوت", "🤖"), ("brosse", "فرشاة", "🪥"), ("bateau", "قارب", "⛵")],
    "c": [("camion", "شاحنة", "🚚"), ("cloche", "جرس", "🔔"), ("cerf", "أيل", "🦌"), ("vache", "بقرة", "🐄"), ("crayon", "قلم رصاص", "✏️"),
          ("ciseaux", "مقص", "✂️"), ("champignon", "فطر", "🍄"), ("canard", "بطة", "🦆"), ("casquette", "كاب", "🧢")],
    "f": [("feuille", "ورقة شجر", "🍃"), ("fiche", "بطاقة", "📄"), ("feu", "نار", "🔥"), ("fenêtre", "نافذة", "🪟"), ("girafe", "زرافة", "🦒"),
          ("fauteuil", "كرسي بذراعين", "🛋️"), ("fantôme", "شبح", "👻"), ("montgolfière", "منطاد", "🎈"), ("fer", "حدوة حصان", "🧲")],
    "h": [("hibou", "بومة", "🦉"), ("hache", "فأس", "🪓"), ("huile", "زيت", "🫙"), ("harpe", "قيثارة", "🎼"), ("haricot", "فاصوليا", "🫘"),
          ("dimanche", "الأحد", "📅"), ("écharpe", "وشاح", "🧣"), ("pêche", "خوخة", "🍑"), ("niche", "بيت الكلب", "🏠")],
    "j": [("jonquille", "نرجس", "🌼"), ("jouets", "ألعاب", "🧸"), ("jument", "فرس", "🐴"), ("journal", "جريدة", "📰"), ("jongler", "يلعب بالكرات", "🤹"),
          ("jupe", "تنورة", "👗"), ("jaguar", "جاكوار", "🐆"), ("jarre", "جرة", "🏺"), ("joue", "خد", "😊")],
    "k": [("kangourou", "كنغر", "🦘"), ("karatéka", "لاعب كاراتيه", "🥋"), ("kayak", "كاياك", "🛶"), ("skieur", "متزلج", "⛷️"), ("kiwi", "كيوي", "🥝"),
          ("koala", "كوالا", "🐨"), ("karting", "سيارة سباق صغيرة", "🏎️"), ("yak", "ثور الياك", "🐂"), ("basketteur", "لاعب سلة", "⛹️")],
    "n": [("chien", "كلب", "🐕"), ("papillon", "فراشة", "🦋"), ("lion", "أسد", "🦁"), ("bonbon", "حلوى", "🍬"), ("diamant", "ماسة", "💎"),
          ("âne", "حمار", "🫏"), ("lunettes", "نظارة", "👓"), ("journal", "جريدة", "📰"), ("Lune", "القمر", "🌙")],
    "o": [("vélo", "دراجة", "🚲"), ("lion", "أسد", "🦁"), ("brosse", "فرشاة", "🪥"), ("ballon", "بالون", "🎈"), ("jouets", "ألعاب", "🧸"),
          ("robot", "روبوت", "🤖"), ("moto", "دراجة نارية", "🏍️"), ("olive", "زيتونة", "🫒"), ("homme", "رجل", "👨"), ("lavabo", "حوض", "🚰")],
    "r": [("écureuil", "سنجاب", "🐿️"), ("collier", "عقد", "📿"), ("règle", "مسطرة", "📏"), ("grenouille", "ضفدع", "🐸"), ("robot", "روبوت", "🤖"),
          ("ours", "دب", "🐻"), ("rose", "وردة", "🌹"), ("réveil", "منبه", "⏰"), ("rhinocéros", "وحيد القرن", "🦏"), ("parapluie", "مظلة", "☂️")],
    "s": [("chaussettes", "جوارب", "🧦"), ("cerises", "كرز", "🍒"), ("scie", "منشار", "🪚"), ("poisson", "سمكة", "🐟"), ("rose", "وردة", "🌹"),
          ("oiseau", "طائر", "🐦"), ("singe", "قرد", "🐒"), ("maison", "بيت", "🏠"), ("ciseaux", "مقص", "✂️"), ("casque", "خوذة", "⛑️")],
    "u": [("tulipe", "زهرة توليب", "🌷"), ("parapluie", "مظلة", "☂️"), ("écureuil", "سنجاب", "🐿️"), ("nuage", "سحابة", "☁️"), ("jument", "فرس", "🐴"),
          ("tortue", "سلحفاة", "🐢"), ("lunettes", "نظارة", "👓"), ("Lune", "القمر", "🌙"), ("jus", "عصير", "🧃"), ("jupe", "تنورة", "👗")],
    "x": [("taxi", "تاكسي", "🚕"), ("boxe", "ملاكمة", "🥊"), ("xylophone", "إكسيليفون", "🎵"), ("mixeur", "خلاط", "🥤"), ("klaxon", "بوق", "📯"),
          ("dix", "عشرة", "🔟"), ("six", "ستة", "6️⃣"), ("hexagone", "شكل سداسي", "⬡"), ("saxophone", "ساكسفون", "🎷"), ("bombyx", "دودة القز", "🐛")],
    "y": [("yacht", "يخت", "🛥️"), ("yaourt", "زبادي", "🍦"), ("yeux", "عيون", "👀"), ("rugby", "رجبي", "🏉"), ("crayon", "قلم رصاص", "✏️"),
          ("cygne", "بجعة", "🦢"), ("cycle", "دراجة", "🚴"), ("xylophone", "إكسيليفون", "🎵"), ("gymnastique", "جمباز", "🤸"), ("yak", "ثور الياك", "🐂")],
}

# ------------------------------------------------ Unit 2 vocabulary
# Chapter 1 - salutations
add("bonjour", "Bonjour", "", "صباح الخير / مرحباً", "🌞", "a smiling girl waving hello in the morning sunshine")
add("salut", "Salut", "", "أهلاً (بين الأصدقاء)", "👋", "two school friends greeting each other with a high five in a schoolyard")
add("bonne_journee", "Bonne journée", "", "يوماً سعيداً", "☀️", "a mother waving goodbye to her daughter getting on a yellow school bus in the morning")
add("au_revoir", "Au revoir", "", "إلى اللقاء", "🚌", "a girl waving goodbye from the window of a school bus")
add("bonne_rentree", "Bonne rentrée", "", "عودة مدرسية سعيدة", "🏫", "a kind teacher welcoming children at the school door on the first day of school")
add("bon_appetit", "Bon appétit", "", "بالهناء والشفاء", "🍽️", "a family sitting at the table about to eat lunch together, smiling")
add("bonsoir", "Bonsoir", "", "مساء الخير", "🌆", "a girl greeting her father in the evening, orange sunset through the window")
add("bonne_nuit", "Bonne nuit", "", "تصبح على خير", "🌙", "a mother tucking her daughter into bed at night, a crescent moon through the window")
add("madame", "Madame", "", "سيدة / مدام", "👩", img=False)
add("maitresse", "maitresse", "La", "المعلّمة", "👩‍🏫", "a kind woman teacher standing in front of a blackboard")
add("mistou", "Mistou", "", "ميستو (القط)", "🐱", "a cute curious grey kitten with big eyes, sitting")
add("marie", "Marie", "", "ماري (البنت)", "👧", "a happy eight-year-old girl with long brown hair and a school bag")
add("bon_voyage", "Bon voyage", "", "رحلة سعيدة", "✈️", "a father with a suitcase waving goodbye at an airport")
add("bon_travail", "Bon travail", "", "عملاً موفقاً", "📚", "a boy doing his homework at a desk, concentrating")
add("bonne_soiree", "Bonne soirée", "", "أمسية سعيدة", "🌇", img=False)

# Chapter 2 - comment s'appelle-t-il
add("fille", "fille", "Une", "بنت", "👧", "a smiling eight-year-old girl")
add("garcon", "garçon", "Un", "ولد", "👦", "a smiling eight-year-old boy")
add("souris", "souris", "Une", "فأرة", "🐭", "a small grey mouse")
add("chat", "chat", "Un", "قط", "🐱", "a grey cat sitting")
add("gentil", "gentil", "", "لطيف (مذكر)", "😊", img=False)
add("gentille", "gentille", "", "لطيفة (مؤنث)", "😊", img=False)
add("curieux", "curieux", "", "فضولي", "🧐", img=False)
add("bruno", "Bruno", "", "برونو (الولد)", "👦", "a cheerful eight-year-old boy with short dark hair and a red t-shirt")
add("annie", "Annie", "", "آني (البنت)", "👧", "a cheerful eight-year-old girl with curly hair and a green dress")

# Chapter 3 - je pose des questions
add("gateau", "gâteau d'anniversaire", "Un", "كعكة عيد ميلاد", "🎂", "a big birthday cake with candles")
add("cadeau", "cadeau d'anniversaire", "Un", "هدية عيد ميلاد", "🎁", "a large wrapped birthday present with a bow")
add("cuisine", "cuisine", "La", "المطبخ", "🍳", "a bright kitchen with a stove, a sink and cupboards")
add("amis", "amis", "Les", "الأصدقاء", "👫", "a group of four happy children, friends, at a birthday party")
add("grand", "grand", "", "كبير", "📏", img=False)
add("feter", "fêter", "", "يحتفل", "🎉", img=False)
add("preparer", "préparer", "", "يُحضّر / يُعدّ", "👩‍🍳", img=False)
add("papa", "papa", "", "بابا", "👨", "a smiling father")
add("maman", "maman", "", "ماما", "👩", "a smiling mother")
add("livre", "livre", "Un", "كتاب", "📖", img=False)
add("bus", "bus", "Le", "الحافلة", "🚌", img=False)
add("ecole", "école", "L'", "المدرسة", "🏫", img=False)

# Chapter 4 - la maison
add("salon", "salon", "Le", "غرفة الجلوس / الصالون", "🛋️", "a cosy living room with a sofa, an armchair, a small table and a television")
add("salle_a_manger", "salle à manger", "La", "غرفة الطعام", "🍽️", "a dining room with a big table, many chairs and a sideboard")
add("chambre", "chambre", "La", "غرفة النوم", "🛏️", "a child's bedroom with two beds, a bedside table, a lamp, a desk and a wardrobe")
add("salle_de_bain", "salle de bain", "La", "الحمّام", "🛁", "a bathroom with a bathtub, a shower, a washbasin, a toilet and a mirror cabinet")

HOUSE = {
    "salon": [("canape", "canapé", "Un", "كنبة", "🛋️", "a comfortable sofa with cushions"),
              ("fauteuil", "fauteuil", "Un", "كرسي بذراعين", "💺", "a soft armchair"),
              ("televiseur", "téléviseur", "Un", "تلفاز", "📺", "a flat television on a stand"),
              ("table_salon", "table", "Une", "طاولة", "🪑", "a small round wooden coffee table")],
    "cuisine": [("evier", "évier", "Un", "حوض المطبخ", "🚰", "a kitchen sink with a tap"),
                ("four", "four", "Un", "فرن", "🔥", "a kitchen oven with the door closed"),
                ("lave_vaisselle", "lave-vaisselle", "Un", "غسالة أطباق", "🍽️", "a dishwasher with its door slightly open showing clean plates"),
                ("refrigerateur", "réfrigérateur", "Un", "ثلاجة", "🧊", "a white refrigerator"),
                ("lave_linge", "lave-linge", "Un", "غسالة ملابس", "🧺", "a front-loading washing machine"),
                ("placard", "placard", "Un", "دولاب مطبخ", "🗄️", "a kitchen wall cupboard with its door open showing plates and cups")],
    "salle_a_manger": [("grande_table", "grande table", "Une", "طاولة كبيرة", "🍽️", "a big dining table"),
                       ("chaises", "chaises", "Des", "كراسي", "🪑", "three wooden dining chairs in a row"),
                       ("buffet", "buffet", "Un", "خزانة الأطباق (بوفيه)", "🗄️", "a wooden sideboard cabinet with plates on top")],
    "chambre": [("lits", "lits", "Deux", "سريران", "🛏️", "two single beds side by side with colourful blankets"),
                ("table_de_nuit", "table de nuit", "Une", "منضدة السرير", "🕯️", "a small bedside table with a drawer"),
                ("lampe", "lampe", "Une", "مصباح", "💡", "a bedside lamp with a shade, switched on"),
                ("bureau", "bureau", "Un", "مكتب", "🖥️", "a child's desk with a chair and a pencil pot"),
                ("armoire", "armoire", "Une", "خزانة ملابس", "🚪", "a tall wooden wardrobe with two doors")],
    "salle_de_bain": [("baignoire", "baignoire", "Une", "حوض الاستحمام", "🛁", "a white bathtub with bubbles"),
                      ("douche", "douche", "Une", "دُش", "🚿", "a shower head with water running"),
                      ("lavabo_sdb", "lavabo", "Un", "حوض الغسيل", "🚰", "a white bathroom washbasin with a tap"),
                      ("wc", "W.-C.", "Un", "مرحاض", "🚽", "a white toilet"),
                      ("miroir", "miroir", "Un", "مرآة", "🪞", "a round mirror on a wall")],
}
for room, items in HOUSE.items():
    for key, fr, art, ar, emoji, desc in items:
        add(key, fr, art, ar, emoji, desc, room=room)

# Grammar nouns (chapter 5)
for key, fr, art, ar, emoji in [
    ("jour", "jour", "Le", "اليوم / النهار", "🌞"), ("journee", "journée", "La", "اليوم (كله)", "☀️"), ("soir", "soir", "Le", "المساء", "🌆"),
    ("soiree", "soirée", "La", "الأمسية", "🌇"), ("appetit", "appétit", "L'", "الشهية", "🍽️"), ("nuit", "nuit", "La", "الليل", "🌙"),
    ("rentree", "rentrée", "La", "العودة إلى المدرسة", "🏫"), ("anniversaire", "anniversaire", "Un", "عيد ميلاد", "🎂"), ("amie", "amie", "Une", "صديقة", "👧"),
    ("television", "télévision", "La", "التلفزيون", "📺"), ("famille", "famille", "La", "العائلة", "👨‍👩‍👧"), ("voyage", "voyage", "Le", "الرحلة", "✈️"),
    ("travail", "travail", "Le", "العمل", "📚"), ("professeur", "professeur", "Le", "المعلّم", "👨‍🏫"), ("monsieur", "monsieur", "Un", "سيد", "👨"),
    ("lit", "lit", "Un", "سرير", "🛏️"), ("chaise", "chaise", "Une", "كرسي", "🪑")]:
    add(key, fr, art, ar, emoji, img=False)
add("maison", "maison", "La", "البيت", "🏠", "a cosy family house with a red roof and a garden")

# ------------------------------------------------ Extras (lessons beyond the book)
NUMBERS = [("zero", "zéro", "صفر"), ("un_n", "un", "واحد"), ("deux", "deux", "اثنان"), ("trois", "trois", "ثلاثة"), ("quatre", "quatre", "أربعة"),
           ("cinq", "cinq", "خمسة"), ("six_n", "six", "ستة"), ("sept", "sept", "سبعة"), ("huit_n", "huit", "ثمانية"), ("neuf", "neuf", "تسعة"), ("dix_n", "dix", "عشرة")]
NUM_EMOJI = ["0️⃣", "1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣", "🔟"]
for i, (key, fr, ar) in enumerate(NUMBERS):
    if key != "zero":
        add(key, fr, "", ar, NUM_EMOJI[i], img=False, number=i)
W["zero"]["number"] = 0

COLORS = [("rouge", "rouge", "أحمر", "🔴", "#e53935"), ("vert", "vert", "أخضر", "🟢", "#43a047"), ("bleu", "bleu", "أزرق", "🔵", "#1e88e5"),
          ("jaune", "jaune", "أصفر", "🟡", "#fdd835"), ("noir", "noir", "أسود", "⚫", "#212121"), ("blanc", "blanc", "أبيض", "⚪", "#fafafa"),
          ("orange_c", "orange", "برتقالي", "🟠", "#fb8c00"), ("rose_c", "rose", "وردي", "🩷", "#ec407a"), ("gris", "gris", "رمادي", "🩶", "#9e9e9e"),
          ("marron", "marron", "بني", "🟤", "#6d4c41"), ("violet", "violet", "بنفسجي", "🟣", "#8e24aa")]
for key, fr, ar, emoji, hexcode in COLORS:
    add(key, fr, "", ar, emoji, img=False, color=hexcode)

ANIMALS = [("chien", "chien", "Un", "كلب", "🐕"), ("lapin", "lapin", "Un", "أرنب", "🐰"), ("hamster", "hamster", "Un", "هامستر", "🐹"),
           ("cheval", "cheval", "Un", "حصان", "🐴"), ("vache", "vache", "Une", "بقرة", "🐄"), ("mouton", "mouton", "Un", "خروف", "🐑"),
           ("lion", "lion", "Un", "أسد", "🦁"), ("ours", "ours", "Un", "دب", "🐻"), ("poisson", "poisson", "Un", "سمكة", "🐟"),
           ("oiseau", "oiseau", "Un", "طائر", "🐦"), ("elephant", "éléphant", "Un", "فيل", "🐘"), ("crocodile", "crocodile", "Un", "تمساح", "🐊")]
for key, fr, art, ar, emoji in ANIMALS:
    add(key, fr, art, ar, emoji, img=False)

FAMILY = [("grand_pere", "grand-père", "Le", "الجد", "👴"), ("grand_mere", "grand-mère", "La", "الجدة", "👵"),
          ("frere", "frère", "Le", "الأخ", "👦"), ("soeur", "sœur", "La", "الأخت", "👧"), ("bebe", "bébé", "Le", "الرضيع", "👶")]
for key, fr, art, ar, emoji in FAMILY:
    add(key, fr, art, ar, emoji, img=False)

SCHOOL = [("cartable", "cartable", "Un", "حقيبة المدرسة", "🎒"), ("cahier", "cahier", "Un", "كراسة", "📓"), ("stylo", "stylo", "Un", "قلم حبر", "🖊️"),
          ("gomme_s", "gomme", "Une", "ممحاة", "🩹"), ("regle_s", "règle", "Une", "مسطرة", "📏"), ("tableau", "tableau", "Le", "السبورة", "🟩"),
          ("classe", "classe", "La", "الفصل", "🏫"), ("eleve", "élève", "L'", "التلميذ", "🧒")]
for key, fr, art, ar, emoji in SCHOOL:
    add(key, fr, art, ar, emoji, img=False)


def word(key):
    return W[key]


def label(key, with_article=True):
    w = W[key]
    if with_article and w["art"]:
        return w["art"] + ("" if w["art"].endswith("'") else " ") + w["fr"]
    return w["fr"]


def pic(key):
    """What the client shows: a generated picture when present, else the emoji."""
    w = W[key]
    return {"emoji": w["emoji"], "img": key if w.get("img") else None}


def card(key, with_article=True):
    w = W[key]
    return dict(key=key, text=label(key, with_article), fr=w["fr"], ar=w["ar"], **pic(key))
