# Copyright (c) 2024 Piyawish Piyawat
# Licensed under the MIT License

PYTHON_KEYWORDS = {
    "and": "และ",
    "as": "เป็น",
    "assert": "ยืนยัน",
    "async": "อะซิงค์",
    "await": "รอ",
    "break": "หยุด",
    "class": "คลาส",
    "continue": "ทำต่อ",
    "def": "นิยาม",
    "del": "ลบ",
    "elif": "หรือถ้า",
    "else": "อื่น",
    "except": "ยกเว้น",
    "False": "เท็จ",
    "finally": "สุดท้าย",
    "for": "สำหรับ",
    "from": "จาก",
    "global": "ทั่วไป",
    "if": "ถ้า",
    "import": "นำเข้า",
    "in": "ใน",
    "is": "คือ",
    "lambda": "แลมบ์ดา",
    "nonlocal": "นอกเขต",
    "None": "ไม่มี",
    "not": "ไม่",
    "or": "หรือ",
    "pass": "ผ่าน",
    "raise": "ยก",
    "return": "คืนค่า",
    "True": "จริง",
    "try": "ลอง",
    "while": "ขณะ",
    "with": "ด้วย",
    "yield": "ให้",
}

PYTHON_BUILTIN_FUNCTIONS = {
    "abs": "ค่าสัมบูรณ์",
    "aiter": "อิเทอเรเตอร์อะซิงค์",
    "all": "ทั้งหมด",
    "anext": "ถัดไปอะซิงค์",
    "any": "ใดๆ",
    "ascii": "แอสกี",
    "bin": "ฐานสอง",
    "bool": "บูลีน",
    "breakpoint": "จุดพัก",
    "bytearray": "แถวไบต์",
    "bytes": "ไบต์",
    "callable": "เรียกได้",
    "chr": "อักขระ",
    "classmethod": "เมธอดคลาส",
    "compile": "คอมไพล์",
    "complex": "จำนวนเชิงซ้อน",
    "delattr": "ลบแอททริบิวต์",
    "dict": "พจนานุกรม",
    "dir": "ไดเรกทอรี",
    "divmod": "หารเอาเศษ",
    "enumerate": "ลำดับ",
    "eval": "ประเมิน",
    "exec": "ประมวลผล",
    "filter": "กรอง",
    "float": "ทศนิยม",
    "format": "จัดรูปแบบ",
    "frozenset": "เซ็ตแช่แข็ง",
    "getattr": "รับแอททริบิวต์",
    "globals": "ตัวแปรโกลบอล",
    "hasattr": "มีแอททริบิวต์",
    "hash": "แฮช",
    "help": "ช่วยเหลือ",
    "hex": "ฐานสิบหก",
    "id": "รหัส",
    "input": "รับค่า",
    "int": "จำนวนเต็ม",
    "isinstance": "เป็นอินสแตนซ์",
    "issubclass": "เป็นคลาสลูก",
    "iter": "วนซ้ำ",
    "len": "ความยาว",
    "list": "รายการ",
    "locals": "ตัวแปรท้องถิ่น",
    "map": "แปลง",
    "max": "ค่าสูงสุด",
    "memoryview": "มุมมองหน่วยความจำ",
    "min": "ค่าต่ำสุด",
    "next": "ถัดไป",
    "object": "วัตถุ",
    "oct": "ฐานแปด",
    "open": "เปิด",
    "ord": "รหัสอักขระ",
    "pow": "ยกกำลัง",
    "print": "พิมพ์",
    "property": "คุณสมบัติ",
    "range": "ช่วง",
    "repr": "ตัวแทน",
    "reversed": "ย้อนกลับ",
    "round": "ปัดเศษ",
    "set": "เซ็ต",
    "setattr": "ตั้งแอททริบิวต์",
    "slice": "ตัดส่วน",
    "sorted": "เรียงลำดับ",
    "staticmethod": "เมธอดคงที่",
    "str": "สตริง",
    "sum": "ผลรวม",
    "super": "คลาสแม่",
    "tuple": "ทูเพิล",
    "type": "ชนิด",
    "vars": "ตัวแปร",
    "zip": "จับคู่",
    "__import__": "__นำเข้า__",
}

SPECIAL_BUILTIN_VARIABLES = {
    "__name__": "__ชื่อ__",
    "__doc__": "__เอกสาร__",
    "__file__": "__ไฟล์__",
    "__dict__": "__พจนานุกรม__",
    "__package__": "__แพ็กเกจ__",
    "__path__": "__เส้นทาง__",
    "__module__": "__โมดูล__",
    "__bases__": "__คลาสฐาน__",
    "__class__": "__คลาส__",
    "__init__": "__เริ่มต้น__",
    "__del__": "__ลบ__",
    "__repr__": "__ตัวแทนทางการ__",
    "__str__": "__ตัวแทน__",
    "__bytes__": "__ไบต์__",
    "__format__": "__จัดรูปแบบ__",
    "__lt__": "__น้อยกว่า__",
    "__le__": "__น้อยกว่าเท่ากับ__",
    "__eq__": "__เท่ากับ__",
    "__ne__": "__ไม่เท่ากับ__",
    "__gt__": "__มากกว่า__",
    "__ge__": "__มากกว่าเท่ากับ__",
    "__hash__": "__แฮช__",
    "__bool__": "__บูลีน__",
    "__call__": "__เรียกใช้__",
    "__len__": "__ความยาว__",
    "__getitem__": "__เข้าถึงสมาชิก__",
    "__setitem__": "__กำหนดสมาชิก__",
    "__delitem__": "__ลบสมาชิก__",
    "__iter__": "__วนซ้ำ__",
    "__next__": "__ถัดไป__",
    "__enter__": "__เข้า__",
    "__exit__": "__ออก__",
    "__slots__": "__ช่องเก็บ__",
    "__all__": "__ทั้งหมด__",
}

PY_TO_THAI = {
    **PYTHON_KEYWORDS,
    **PYTHON_BUILTIN_FUNCTIONS,
    **SPECIAL_BUILTIN_VARIABLES,
}

THAI_TO_PY = {v: k for k, v in PY_TO_THAI.items()}

# clean up
del PYTHON_KEYWORDS
del PYTHON_BUILTIN_FUNCTIONS
