import gradio as gr # Basic English-to-Spanish dictionary def translate(word): dictionary = { "dog": "perro", "cat": "gato", "house": "casa", "hello": "hola", "goodbye": "adiós", "thank you": "gracias", "please": "por favor", "water": "agua", "food": "comida", "school": "escuela" } return dictionary.get(word.lower().strip(), "🔍 Try a different word!") # Gradio interface gr.Interface( fn=translate, inputs=gr.Textbox(label="Type an English word"), outputs=gr.Textbox(label="Spanish Translation"), title="📚 Spanifyd Flashcard Translator", description="Type a word in English to learn the Spanish word. More features coming soon!" ).launch()