Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ def main():
|
|
51 |
st.markdown("<h1 style='text-align: center; color: #4285F4;'>Multilingual Translator</h1>", unsafe_allow_html=True)
|
52 |
st.markdown("<p style='text-align: center; color: #666;'>Effortless Multilingual Translation</p>", unsafe_allow_html=True)
|
53 |
|
54 |
-
# Custom CSS to
|
55 |
st.markdown(
|
56 |
"""
|
57 |
<style>
|
@@ -64,7 +64,7 @@ def main():
|
|
64 |
font-size: 0.8em !important;
|
65 |
}
|
66 |
.stFileUploader label::after {
|
67 |
-
content: '
|
68 |
}
|
69 |
</style>
|
70 |
""",
|
@@ -92,6 +92,9 @@ def main():
|
|
92 |
st.selectbox("Target Language", options=target_options, index=target_options.index(f"{LANGUAGES['en'][0]} ({LANGUAGES['en'][1]})") if "English" not in source_lang_display else 0, key="target_lang")
|
93 |
if "translated_text" in st.session_state:
|
94 |
st.text_area("Output Text", value=st.session_state.translated_text, height=400, key="output_text", disabled=True, label_visibility="hidden")
|
|
|
|
|
|
|
95 |
# Footer
|
96 |
if "translated_text" in st.session_state:
|
97 |
st.markdown("""
|
@@ -102,9 +105,6 @@ def main():
|
|
102 |
</a>
|
103 |
</p>
|
104 |
""", unsafe_allow_html=True)
|
105 |
-
# Play audio button and playback below output
|
106 |
-
if st.button("🔊", key="audio_btn", on_click=play_audio, args=(audio_processor_module,), help="Play audio", use_container_width=False):
|
107 |
-
pass
|
108 |
|
109 |
except Exception as e:
|
110 |
st.error(f"App error: {e}")
|
|
|
51 |
st.markdown("<h1 style='text-align: center; color: #4285F4;'>Multilingual Translator</h1>", unsafe_allow_html=True)
|
52 |
st.markdown("<p style='text-align: center; color: #666;'>Effortless Multilingual Translation</p>", unsafe_allow_html=True)
|
53 |
|
54 |
+
# Custom CSS to hide size limit and show only file types
|
55 |
st.markdown(
|
56 |
"""
|
57 |
<style>
|
|
|
64 |
font-size: 0.8em !important;
|
65 |
}
|
66 |
.stFileUploader label::after {
|
67 |
+
content: 'TXT, DOCX, PDF' !important;
|
68 |
}
|
69 |
</style>
|
70 |
""",
|
|
|
92 |
st.selectbox("Target Language", options=target_options, index=target_options.index(f"{LANGUAGES['en'][0]} ({LANGUAGES['en'][1]})") if "English" not in source_lang_display else 0, key="target_lang")
|
93 |
if "translated_text" in st.session_state:
|
94 |
st.text_area("Output Text", value=st.session_state.translated_text, height=400, key="output_text", disabled=True, label_visibility="hidden")
|
95 |
+
# Play audio button and playback below output
|
96 |
+
if st.button("🔊", key="audio_btn", on_click=play_audio, args=(audio_processor_module,), help="Play audio", use_container_width=False):
|
97 |
+
pass
|
98 |
# Footer
|
99 |
if "translated_text" in st.session_state:
|
100 |
st.markdown("""
|
|
|
105 |
</a>
|
106 |
</p>
|
107 |
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
108 |
|
109 |
except Exception as e:
|
110 |
st.error(f"App error: {e}")
|