Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -94,13 +94,19 @@ st.markdown('<h1 class="title">Tagba Translator</h1>', unsafe_allow_html=True)
|
|
| 94 |
col1, col_swap, col2 = st.columns([1, 0.05, 1], gap="small")
|
| 95 |
|
| 96 |
|
| 97 |
-
if "translation" not in st.session_state:
|
| 98 |
-
|
| 99 |
|
| 100 |
if "translation" not in st.session_state:
|
| 101 |
st.session_state.translation = "Traduction"
|
| 102 |
|
|
|
|
|
|
|
|
|
|
| 103 |
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
with col1:
|
| 106 |
st.markdown('<h3 class="col-container">'+st.session_state.source_lang+'</h3>', unsafe_allow_html=True)
|
|
@@ -110,13 +116,6 @@ with col1:
|
|
| 110 |
placeholder="Entrez un texte ici"
|
| 111 |
)
|
| 112 |
|
| 113 |
-
with col_swap:
|
| 114 |
-
st.write("")
|
| 115 |
-
swap = st.button("⇄")
|
| 116 |
-
|
| 117 |
-
if swap:
|
| 118 |
-
st.session_state.source_lang, st.session_state.target_lang = st.session_state.target_lang, st.session_state.source_lang
|
| 119 |
-
st.session_state.text_to_translate, st.session_state.translation = st.session_state.translation, st.session_state.text_to_translate
|
| 120 |
|
| 121 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 122 |
if st.button("Traduire"):
|
|
|
|
| 94 |
col1, col_swap, col2 = st.columns([1, 0.05, 1], gap="small")
|
| 95 |
|
| 96 |
|
| 97 |
+
#if "translation" not in st.session_state:
|
| 98 |
+
# st.session_state.text_to_translate = " "
|
| 99 |
|
| 100 |
if "translation" not in st.session_state:
|
| 101 |
st.session_state.translation = "Traduction"
|
| 102 |
|
| 103 |
+
with col_swap:
|
| 104 |
+
st.write("")
|
| 105 |
+
swap = st.button("⇄")
|
| 106 |
|
| 107 |
+
if swap:
|
| 108 |
+
st.session_state.source_lang, st.session_state.target_lang = st.session_state.target_lang, st.session_state.source_lang
|
| 109 |
+
# st.session_state.text_to_translate, st.session_state.translation = st.session_state.translation, st.session_state.text_to_translate
|
| 110 |
|
| 111 |
with col1:
|
| 112 |
st.markdown('<h3 class="col-container">'+st.session_state.source_lang+'</h3>', unsafe_allow_html=True)
|
|
|
|
| 116 |
placeholder="Entrez un texte ici"
|
| 117 |
)
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
st.markdown('</div>', unsafe_allow_html=True)
|
| 121 |
if st.button("Traduire"):
|