"""
Key-label mappings for generic mixed categories.

ART_MOVEMENTS,
BASE_LABELS,
BOOK_CATEGORIES,
BOOK_TYPES,
CINEMA_CATEGORIES,
clubs_teams_leagues,
ctl_data,
DIRECTIONS,
keys_of_without_in,
LITERATURE_AREAS,
REGIONS,
SCHOOL_LABELS,
tato_type,
TOWNS_COMMUNITIES,
WEAPON_CLASSIFICATIONS,
WEAPON_EVENTS,
WORD_AFTER_YEARS,

"""

from __future__ import annotations

from typing import Dict

from ..data_builders.build_all_keys2 import (
    _build_book_entries,
    _build_cinema_entries,
    _build_literature_area_entries,
    _update_lowercase,
    build_pf_keys2,
    handle_the_prefix,
)
from ..helps import len_print
from ..utils import open_json_file

# from ..jobs import SINGERS_TAB
# from ..languages import MEDIA_CATEGORY_TRANSLATIONS, language_key_translations
# from ..sports import TENNIS_KEYS
# from ..tv import film_keys_for_female, film_keys_for_male
# from .all_keys3 import ALBUMS_TYPE, pop_final_3
# from .all_keys4 import new2019
# from .keys2 import keys2_py
# from .keys_23 import NEW_2023
# from .Newkey import pop_final6

BASE_LABELS: Dict[str, str] = {
    "international reactions": "ردود فعل دولية",
    "domestic reactions": "ردود فعل محلية",
    "foreign involvement": "التدخل الأجنبي",
    "hostage crisis": "أزمة الرهائن",
    "violations of medical neutrality": "انتهاكات الحياد الطبي",
    "misinformation": "معلومات مضللة",
    "reactions": "ردود فعل",
    "israeli–palestinian conflict": "الصراع الإسرائيلي الفلسطيني",
    "legal issues": "قضايا قانونية",
    "stone-throwing": "رمي الحجارة",
    "temple mount and al-aqsa": "جبل الهيكل والأقصى",
    "sexual violence": "عنف جنسي",
    "hamas": "حماس",
    "law": "قانون",
    "books": "كتب",
    "military": "عسكرية",
    "the israel–hamas war": "الحرب الفلسطينية الإسرائيلية",
    "israel–hamas war": "الحرب الفلسطينية الإسرائيلية",
    "israel–hamas war protests": "احتجاجات الحرب الفلسطينية الإسرائيلية",
    "navy of": "بحرية",
    "gulf of": "خليج",
    "acts of": "أفعال",
}

DIRECTIONS: Dict[str, str] = {
    "southeast": "جنوب شرق",
    "southwest": "جنوب غرب",
    "northwest": "شمال غرب",
    "northeast": "شمال شرق",
    "north": "شمال",
    "south": "جنوب",
    "west": "غرب",
    "east": "شرق",
}

REGIONS: Dict[str, str] = {
    "asia": "آسيا",
    "europe": "أوروبا",
    "africa": "إفريقيا",
    # "america":"أمريكا",
    "oceania": "أوقيانوسيا",
}

SCHOOL_LABELS: Dict[str, str] = {
    "bilingual schools": "مدارس {} ثنائية اللغة",
    "high schools": "مدارس ثانوية {}",
    "middle schools": "مدارس إعدادية {}",
    "elementary schools": "مدارس إبتدائية {}",
}

WORD_AFTER_YEARS: Dict[str, str] = {
    "YouTube channels": "قنوات يوتيوب",
    "births": "مواليد",
    "space probes": "مسبارات فضائية",
    "spacecraft": "مركبات فضائية",
    "spaceflight": "رحلات الفضاء",
    "works": "أعمال",
    "clashes": "اشتباكات",
    "endings": "نهايات",
    "fires": "حرائق",
    "tsunamis": "أمواج تسونامي",
    "landslides": "انهيارات أرضية",
    "floods": "فيضانات",
    "hoaxes": "خدع",
    "earthquakes": "زلازل",
    "elections": "انتخابات",
    "conferences": "مؤتمرات",
    "contests": "منافسات",
    "ballot measures": "إجراءات اقتراع",
    "ballot propositions": "اقتراحات اقتراع",
    "referendums": "استفتاءات",
    "beginnings": "بدايات",
}

TOWNS_COMMUNITIES: Dict[str, str] = {
    "muslim": "إسلامية",
    "fishing": "صيد",
    "mining": "تعدين",
    "coastal": "شاطئية",
    "ghost": "أشباح",
}

ART_MOVEMENTS: Dict[str, str] = {
    "renaissance": "عصر النهضة",
    "bronze age": "عصر برونزي",
    "stone age": "عصر حجري",
    "pop art": "فن البوب",
    "post-impressionism": "ما بعد الإنطباعية",
    "cubism": "تكعيبية",
    "beat generation": "جيل بيت",
    "romanticism": "رومانسية",
    "prehistoric art": "فن ما قبل التاريخ",
    "contemporary art": "فن معاصر",
    "land art": "فنون أرضية",
    "surrealism": "سريالية",
    "social realism": "الواقعية الإجتماعية",
    "northern renaissance": "عصر النهضة الشمالي",
    "baroque": "باروك",
    "socialist realism": "واقعية اشتراكية",
    "postmodernism": "ما بعد الحداثة",
    "symbolism (arts)": "رمزية",
    "insular art": "فن جزيري",
    "op art": "فن بصري",
    "neoclassicism": "الكلاسيكية الجديدة",
    "orientalism": "استشراق",
    "ukiyo-e": "أوكييو-إه",
    "gothic art": "الفن القوطي",
    "futurism": "مستقبلية",
    "fauvism": "حوشية",
    "mannerism": "مانييريزمو",
    "minimalism": "تقليلية",
    "de stijl": "دي ستايل",
    "classicism": "كلاسيكية",
    "dada": "دادا",
    "constructivism": "بنائية",
    "expressionism": "المذهب التعبيري",
    "constructivism (art)": "بنائية (فنون)",
    "early netherlandish painting": "رسم عصر النهضة المبكر الهولندي",
    "german renaissance": "عصر النهضة الألماني",
    "sturm und drang": "العاصفة والاندفاع",
    "postmodern literature": "أدب ما بعد الحداثة",
    "heidelberg school": "مدرسة هايدلبرغ",
    "literary realism": "واقعية أدبية",
    "impressionism": "انطباعية",
    "realism (art movement)": "واقعية (فنون)",
    "existentialism": "وجودية",
    "magic realism": "واقعية عجائبية",
    "conceptual art": "فن تصويري",
    "art nouveau": "الفن الجديد",
    "romanesque art": "فن رومانسكي",
    "avant-garde art": "طليعية",
    "environmental art": "فن بيئي",
    "byzantine art": "فن بيزنطي",
    "purism": "النقاء",
    "abstract expressionism": "التعبيرية التجريدية",
    "academic art": "فن أكاديمي",
    "art deco": "آرت ديكو",
    "pointillism": "تنقيطية",
    "biedermeier": "بيدرماير",
    "bauhaus": "باوهاوس",
    "realism": "واقعية",
    "latin american art": "فن أمريكا اللاتينية",
    "modernismo": "الحداثة (الأدب باللغة الإسبانية)",
}

WEAPON_CLASSIFICATIONS: Dict[str, str] = {
    "biological": "بيولوجية",
    "chemical": "كيميائية",
    "military nuclear": "نووية عسكرية",
    "nuclear": "نووية",
    "military": "عسكرية",
}

WEAPON_EVENTS: Dict[str, str] = {
    "accidents or incidents": "حوادث",
    "accidents-and-incidents": "حوادث",
    "accidents and incidents": "حوادث",
    "accidents": "حوادث",
    "operations": "عمليات",
    "weapons": "أسلحة",
    "battles": "معارك",
    "sieges": "حصارات",
    "missiles": "صواريخ",
    "technology": "تقانة",
}

BOOK_CATEGORIES: Dict[str, str] = {
    # "live albums":"ألبومات مباشرة",
    "newspaper": "صحف",
    "conferences": "مؤتمرات",
    "events": "أحداث",
    "festivals": "مهرجانات",
    "albums": "ألبومات",
    "awards": "جوائز",
    "bibliographies": "ببليوجرافيات",
    "books": "كتب",
    "migrations": "هجرات",
    "video albums": "ألبومات فيديو",
    "classical albums": "ألبومات كلاسيكية",
    "comedy albums": "ألبومات كوميدية",
    "compilation albums": "ألبومات تجميعية",
    "mixtape albums": "ألبومات ميكستايب",
    "comic book": "كتب قصص مصورة",
    "comic strips": "شرائط كومكس",
    "comic": "قصص مصورة",
    "comics": "قصص مصورة",
    "cookbooks": "كتب طبخ",
    "crime": "جريمة",
    "dictionaries": "قواميس",
    "documentaries": "وثائقيات",
    "documents": "وثائق",
    "encyclopedias": "موسوعات",
    "essays": "مقالات",
    "films": "أفلام",
    "graphic novels": "روايات مصورة",
    "handbooks and manuals": "كتيبات وأدلة",
    "handbooks": "كتيبات",
    "journals": "نشرات دورية",
    "lectures": "محاضرات",
    "magazines": "مجلات",
    "manga": "مانغا",
    "manuals": "أدلة",
    "manuscripts": "مخطوطات",
    "marvel comics": "مارفال كومكس",
    "mmoirs": "مذكرات",
    "movements": "حركات",
    "musicals": "مسرحيات غنائية",
    "newspapers": "صحف",
    "novellas": "روايات قصيرة",
    "novels": "روايات",
    "operas": "أوبيرات",
    "organized crime": "جريمة منظمة",
    "paintings": "لوحات",
    "plays": "مسرحيات",
    "poems": "قصائد",
    "publications": "منشورات",
    "screenplays": "نصوص سينمائية",
    "short stories": "قصص قصيرة",
    "soundtracks": "موسيقى تصويرية",
    "texts": "نصوص",
    "treaties": "اتفاقيات",
    "webcomic": "ويب كومكس",
    "webcomics": "ويب كومكس",
    "websites": "مواقع ويب",
    "wikis": "ويكيات",
}

BOOK_TYPES: Dict[str, str] = {
    # "pirate":"قراصنة",
    "anti-war": "مناهضة للحرب",
    "anti-revisionist": "مناهضة للتحريفية",
    "biographical": "سير ذاتية",
    "children's": "أطفال",
    "childrens": "أطفال",
    "cannabis": "قنب",
    "etiquette": "آداب التعامل",
    "illuminated": "مذهبة",
    "incidents": "حوادث",
    "magic": "سحر",
    "travel guide": "دليل سفر",
    "travel": "سفر",
    "structural": "هيكلية",
    "agricultural": "زراعية",
    "astronomical": "فلكية",
    "chemical": "كيميائية",
    "commercial": "تجارية",
    "economical": "اقتصادية",
    "educational": "تعليمية",
    "environmental": "بيئية",
    "experimental": "تجريبية",
    "historical": "تاريخية",
    "industrial": "صناعية",
    "internal": "داخلية",
    "international": "دولية",
    "legal": "قانونية",
    "magical": "سحرية",
    "medical": "طبية",
    "musical": "موسيقية",
    "nautical": "بحرية",
    "political": "سياسية",
    "residential": "سكنية",
    "reference": "مرجعية",
    "academic": "أكاديمية",
    "biography": "سيرة ذاتية",
    "education": "تعليم",
    "fiction": "خيالية",
    "non-fiction": "غير خيالية",
    "non fiction": "غير خيالية",
    "linguistics": "لغوية",
    "literary": "أدبية",
    "maritime": "بحرية",
    "social": "اجتماعية",
    "youth": "شبابية",
    "arts": "فنية",
    "media": "إعلامية",
    "writing": "الكتابة",
    # "realist":"واقعية",
    # "strategy":"استراتيجية",
    # "transportation":"نقل",
    # "military":"عسكرية",
    # "defense":"دفاعية",
    # "government":"حكومية",
    # "training":"تدريبية",
    # "warfare":"حربية",
    # "research":"بحثية",
    # "logistics":"لوجستية",
}

LITERATURE_AREAS: Dict[str, str] = {
    "literature": "أدب",
    "folklore": "فلكور",
    "poetry": "شعر",
    "film": "فيلم",
}

CINEMA_CATEGORIES: Dict[str, str] = {
    "films": "أفلام",
    "film series": "سلاسل أفلام",
    "television characters": "شخصيات تلفزيونية",
    "television series": "مسلسلات تلفزيونية",
    "miniseries": "مسلسلات قصيرة",
    "television miniseries": "مسلسلات قصيرة تلفزيونية",
    "television news": "أخبار تلفزيونية",
    "television programs": "برامج تلفزيونية",
    "television programmes": "برامج تلفزيونية",
    "television commercials": "إعلانات تجارية تلفزيونية",
    "television films": "أفلام تلفزيونية",
    "radio programs": "برامج إذاعية",
    "television shows": "عروض تلفزيونية",
    "video games": "ألعاب فيديو",
    "comics": "قصص مصورة",
    "marvel comics": "مارفال كومكس",
}

keys_of_without_in = {
    # "explorers": "مستكشفو",
    "historians": "مؤرخو",
    "activities": "أنشطة",
    "adaptations": "تكييفات",
    "adaptations-of-works": "أعمال مقتبسة عن أعمال",
    "aftermath": "ما بعد",
    "ambushes": "كمائن",
    "appellate courts": "محاكم استئناف ولايات",
    "archipelagoes": "أرخبيلات",
    "armies": "جيوش",
    "arrondissements": "دوائر",
    "assassination": "اغتيال",
    "bank": "بنك",
    "basins": "أحواض",
    "battles and operations": "معارك وعمليات",
    "battles": "معارك",
    "bays": "خلجان",
    "beaches": "شواطئ",
    "bibliographies": "ببليوجرافيات",
    "bilateral military relations": "علاقات ثنائية عسكرية",
    "bilateral relations": "علاقات ثنائية",
    "biota": "حيويات",
    "birds": "طيور",
    "borders": "حدود",
    "burial sites": "مواقع دفن",
    "cabinet secretaries": "أعضاء مجلس وزراء",
    "cabinet": "مجلس وزراء",
    "military campaigns": "حملات عسكرية",
    "campaigns": "حملات",
    "campuses": "حرم",
    "cantons": "كانتونات",
    "capitals": "عواصم",
    "caves": "كهوف",
    "chief justices": "رؤساء قضاء",
    "cities": "مدن",
    "city": "مدينة",
    "cliffs": "منحدرات",
    "climate": "مناخ",
    "coastline": "ساحل",
    "coasts": "سواحل",
    "colleges": "كليات",
    "communes": "بلديات",
    "consequences": "عواقب",
    "court systems": "أنظمة محاكم",
    "culture": "ثقافة",
    "daughters": "بنات",
    "death": "موت",
    "depressions": "منخفضات",
    "deserts": "صحاري",
    "dukes": "دوقات",
    "economies": "اقتصادات",
    "economy": "اقتصاد",
    "encyclopedias": "موسوعات",
    "environment": "بيئة",
    "executions": "إعدامات",
    "families": "عائلات",
    "fauna": "حيوانات",
    "fellows": "زملاء",
    "finances": "مالية",
    "flags": "أعلام",
    "flora": "نباتات",
    "foreign relations": "علاقات خارجية",
    "forests and woodlands": "غابات",
    "forests": "غابات",
    "forms": "أشكال",
    "generals": "جنرالات",
    "genres": "أجناس",
    "geography": "جغرافيا",
    "geology": "جيولوجيا",
    "government": "حكومة",
    "gulfs": "خلجان",
    "harbours": "مرافئ",
    "heads of state": "قادة",
    "heads": "قادة",
    "heraldry": "نبالة",
    "hills": "تلال",
    "historiography": "تأريخ",
    "history": "تاريخ",
    "impact": "تأثيرات",
    "impacts": "آثار",
    "incidents": "حوادث",
    "independence": "استقلال",
    "institution": "مؤسسة",
    "internment": "اعتقال",
    "islands": "جزر",
    "judiciary": "النظام القضائي",
    "kings": "ملوك",
    "lakes": "بحيرات",
    "landform": "تضاريس",
    "landforms": "تضاريس",
    "laws": "قوانين",
    "leaders": "قادة",
    "lieutenant governors": "نواب حكام",
    "lists": "قوائم",
    "lords": "لوردات",
    "maritime incidents": "حوادث بحرية",
    "masters": "أساتذة",
    "mayors": "عمدات",
    "members": "أعضاء",
    "mistresses": "عشيقات",
    "mountains": "جبال",
    "municipalities": "بلديات",
    "music": "موسيقى",
    "national symbols": "رموز وطنية",
    "naval battles": "معارك بحرية",
    "occupation": "احتلال",
    "order": "وسام",
    "parishes": "أبرشيات",
    "parliament": "برلمان",
    "party chairs": "رؤساء أحزاب",
    "peoples": "شعوب",
    "persecution": "اضطهاد",
    "personalities": "شخصيات",
    "plains": "سهول",
    "plateaus": "هضاب",
    "politics": "سياسة",
    "ports and harbours": "مرافئ وموانئ",
    "ports": "موانئ",
    "presidencies": "رئاسات",
    "presidency": "رئاسة",
    "president": "رئيس",
    "presidents": "رؤساء",
    "princesses": "أميرات",
    "provinces": "مقاطعات",
    "rectors": "عمدات",
    "reefs": "شعاب",
    "regions": "مناطق",
    "rivers": "أنهار",
    "romanization": "رومنة",
    "rornadoes": "أعاصير",
    "royal families": "عائلات ملكية",
    "rulers": "حكام",
    "seas": "بحار",
    "secretaries of state": "وزراء خارجية",
    "secretaries-of state": "وزراء خارجية",
    "series": "سلسلات",
    "sieges": "حصارات",
    "society": "مجتمع",
    "speakers": "رؤساء",
    "spillover": "امتدادات",
    "sports culture": "ثقافة رياضية",
    "spouses": "قرينات",
    "springs": "ينابيع",
    "sports-culture": "ثقافة رياضية",
    "stadiums": "ملاعب",
    "state appellate courts": "محاكم استئناف ولايات",
    "state cabinet secretaries": "أعضاء مجلس وزراء",
    "state superior courts": "محاكم عليا",
    "state treasurers": "أمناء خزينة ولاية",
    "straits": "مضائق",
    "streams": "جداول",
    "subdivisions": "تقسيمات",
    "submarines": "غواصات",
    "suburbs": "ضواحي",
    "sultans": "سلاطين",
    "superintendents of public instruction": "مدراء تعليم عام",
    "superior courts": "محاكم عليا",
    "symbols": "رموز",
    "terminology": "مصطلحات",
    "terms": "فترات",
    "the-university": "جامعة",
    "tour": "طواف",
    "treasurers": "أمناء خزينة",
    "tribes": "قبائل",
    "typhoons": "تيفونات",
    "umpires": "حكام",
    "underground culture": "ثقافة باطنية",
    "university": "جامعة",
    "valleys": "أودية",
    "variants": "أشكال",
    "variations": "أشكال",
    "vehicles": "مركبات",
    "venues": "ملاعب",
    "vice presidents": "نواب رؤساء",
    "vice-presidents": "نواب رؤساء",
    "victims": "ضحايا",
    "volcanoes": "براكين",
    "wadis": "وديان",
    "waterfalls": "شلالات",
    "wives": "زوجات",
    "works": "أعمال",
    "years": "سنوات",
}

tato_type = {
    "treason": "خيانة",
    "harassment": "مضايقة",
    "archaeological parks": "متنزهات أثرية",
    "architecture museums": "متاحف معمارية",
    "architecture schools": "مدارس عمارة",
    "architecture-schools": "مدارس عمارة",
    "arms trafficking": "الاتجار بالأسلحة",
    "arson": "إحراق الممتلكات",
    "assault": "الاعتداء",
    "attempted murder": "الشروع في القتل",
    "attempted rape": "محاولة الاغتصاب",
    "bank buildings": "مباني بنوك",
    "blackmail": "الابتزاز",
    "blasphemy": "ازدراء الدين",
    "bribery": "الرشوة",
    "building collapses": "انهيارات مباني",
    "burglary": "السطو",
    "child pornography offenses": "جرائم استغلال الأطفال في المواد الإباحية",
    "child sexual abuse": "الاعتداء الجنسي على الأطفال",
    "commercial buildings": "مبان تجارية",
    "cruelty to animals": "القسوة على الحيوانات",
    "culpable homicide": "القتل العمد",
    "cybercrime": "الجريمة الإلكترونية",
    "depriving others of their civil rights": "حرمان الآخرين من حقوقهم المدنية",
    "drama schools": "مدارس درامية",
    "drug offenses": "جرائم المخدرات",
    "embezzlement": "الاختلاس",
    "ethnic groups": "مجموعات عرقية",
    "financial services": "خدمات مالية",
    "hate crimes": "جرائم الكراهيه",
    "historical societies": "جمعيات تاريخية",
    "history museums": "متاحف تاريخية",
    "history organizations": "منظمات تاريخ",
    "holocaust denial offenses": "جرائم إنكار الهولوكوست",
    "hospital buildings": "مباني مستشفيات",
    "incest": "زنى المحارم",
    "independent schools": "مدارس مستقلة",
    "insider trading": "التجارة من الباطن",
    "international crimes": "الجرائم الدولية",
    "international schools": "مدارس دولية",
    "law schools": "مدارس قانون",
    "learned societies": "جمعيات علمية",
    "making false statements": "تقديم بيانات كاذبة",
    "management consulting": "استشارات إدارية",
    "manslaughter": "قتل خطأ",
    "marine art museums": "متاحف فن بحري",
    "marine art": "فن بحري",
    "metals": "المعادن",
    "military academies": "أكاديميات عسكرية",
    "military and war museums": "متاحف عسكرية وحربية",
    "military research": "أبحاث عسكرية",
    "misusing public funds": "إساءة استخدام الأموال العامة",
    "music schools": "مدارس موسيقى",
    "naval museums": "متاحف بحرية",
    "obstruction of justice": "إعاقة سير العدالة",
    "perverting course of justice": "تحريف مسار العدالة",
    "police officers": "ضباط شرطة",
    "private schools": "مدارس خاصة",
    "professional associations": "جمعيات تخصصية",
    "public utilities": "مرافق عمومية",
    "racial hatred offences": "جرائم الكراهية العنصرية",
    "racketeering": "ابتزاز الأموال",
    "rape": "الاغتصاب",
    "real estate services": "خدمات عقارية",
    "refusing to convert to christianity": "رفض اعتناق المسيحية",
    "refusing to convert to islam": "رفض اعتناق الإسلام",
    "robbery": "السرقة",
    "science museums": "متاحف علمية",
    "sex crimes": "الجرائم الجنسية",
    "sex offences": "جرائم جنسية",
    "sexual assault": "اعتداء جنسي",
    "soliciting murder": "التماس القتل",
    "sports museums": "متاحف رياضية",
    "sports schools": "مدارس رياضية",
    "stalking": "المطاردة",
    "tax crimes": "الجرائم الضريبية",
    "teaching hospitals": "مستشفيات تعليمية",
    "trade associations": "اتحادات تجارية",
    "transportation museums": "متاحف النقل",
    "under construction": "تحت الإنشاء",
    "video gaming": "ألعاب الفيديو",
    "witchcraft": "السحر",
    "world war i museums": "متاحف الحرب العالمية الأولى",
    "world war ii museums": "متاحف الحرب العالمية الثانية",
}

ctl_data = open_json_file("sports/clubs_teams_leagues.json") or {}
clubs_teams_leagues = {key.lower(): value for key, value in ctl_data.items()}


def generate_key_mappings(
    keys2_py: Dict[str, str],
    pop_final_3: Dict[str, str],
    singers_tab: Dict[str, str],
    film_keys_for_female: Dict[str, str],
    albums_type: Dict[str, str],
    film_keys_for_male: Dict[str, str],
    tennis_keys: Dict[str, str],
    pop_final6: Dict[str, str],
    media_category_translations: Dict[str, str],
    language_key_translations: Dict[str, str],
    new2019: Dict[str, str],
    new_2023: Dict[str, str],
) -> Dict[str, str]:
    """
    Assemble a consolidated mapping of English keys to Arabic labels by merging multiple category and external translation sources.

    Parameters:
        keys2_py: primary keys mapping for generic categories.
        pop_final_3: population-derived key translations.
        singers_tab: singer-related key translations for book entries.
        film_keys_for_female: film keys related to female subjects used for literature/book integration.
        albums_type: album-type key translations used for book entries.
        film_keys_for_male: film keys related to male subjects used for literature area integration.
        tennis_keys: tennis-related key translations to include (lowercase update applied with skip_existing=true).
        pop_final6: additional population-derived translations to include in lowercase updates.
        media_category_translations: media category translations included in selective lowercase updates.
        language_key_translations: language-related key translations included in broader lowercase updates.
        new2019: external translation set included in broader lowercase updates.
        new_2023: external translation set included in broader lowercase updates.

    Returns:
        Dict[str, str]: A consolidated dictionary mapping normalized English key strings to their Arabic label translations.
    """
    keys_of_with_in = open_json_file("population/keys_of_with_in.json") or {}

    data: Dict[str, str] = build_pf_keys2(
        ART_MOVEMENTS,
        BASE_LABELS,
        ctl_data,
        DIRECTIONS,
        keys2_py,
        keys_of_with_in,
        keys_of_without_in,
        pop_final_3,
        REGIONS,
        SCHOOL_LABELS,
        tato_type,
        TOWNS_COMMUNITIES,
        WEAPON_CLASSIFICATIONS,
        WEAPON_EVENTS,
        WORD_AFTER_YEARS,
    )

    _build_book_entries(
        data,
        singers_tab,
        film_keys_for_female,
        albums_type,
        BOOK_CATEGORIES,
        BOOK_TYPES,
    )

    _build_literature_area_entries(data, film_keys_for_male, LITERATURE_AREAS)
    _build_cinema_entries(data, CINEMA_CATEGORIES)

    _update_lowercase(data, [tennis_keys, pop_final6, media_category_translations], skip_existing=True)
    _update_lowercase(data, [language_key_translations, new2019, new_2023], skip_existing=False)

    no_the = handle_the_prefix(data)
    data.update(no_the)
    return data


# pf_keys2 = generate_key_mappings(keys2_py, pop_final_3, SINGERS_TAB, film_keys_for_female, ALBUMS_TYPE, film_keys_for_male, TENNIS_KEYS, pop_final6, MEDIA_CATEGORY_TRANSLATIONS, language_key_translations, new2019, NEW_2023)

len_print.data_len(
    "all_keys2.py",
    {
        # "pf_keys2": pf_keys2,
        "keys_of_without_in": keys_of_without_in,
        "clubs_teams_leagues": clubs_teams_leagues,
        "WORD_AFTER_YEARS": WORD_AFTER_YEARS,
        "BOOK_CATEGORIES": BOOK_CATEGORIES,
        "BOOK_TYPES": BOOK_TYPES,
    },
)

__all__ = [
    # "pf_keys2",
    "keys_of_without_in",
    "clubs_teams_leagues",
    "WORD_AFTER_YEARS",
    "BOOK_CATEGORIES",
]
