JessicaTH commited on
Commit
77c4959
·
verified ·
1 Parent(s): c33837e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -5
app.py CHANGED
@@ -93,12 +93,8 @@ st.markdown('<h1 class="title">Tagba Translator</h1>', unsafe_allow_html=True)
93
 
94
  col1, col_swap, col2 = st.columns([1, 0.05, 1], gap="small")
95
 
96
- with col_swap:
97
- st.write("")
98
- swap = st.button("⇄")
99
 
100
- if swap:
101
- st.session_state.source_lang, st.session_state.target_lang = st.session_state.target_lang, st.session_state.source_lang
102
 
103
  if "translation" not in st.session_state:
104
  st.session_state.translation = "Traduction"
@@ -135,5 +131,16 @@ with col2:
135
  value=st.session_state.translation,
136
  height=200
137
  )
 
 
 
 
 
 
 
 
 
 
 
138
  st.markdown('</div>', unsafe_allow_html=True)
139
 
 
93
 
94
  col1, col_swap, col2 = st.columns([1, 0.05, 1], gap="small")
95
 
 
 
 
96
 
97
+
 
98
 
99
  if "translation" not in st.session_state:
100
  st.session_state.translation = "Traduction"
 
131
  value=st.session_state.translation,
132
  height=200
133
  )
134
+
135
+ with col_swap:
136
+ st.write("")
137
+ swap = st.button("⇄")
138
+
139
+ if swap:
140
+ st.session_state.source_lang, st.session_state.target_lang = st.session_state.target_lang, st.session_state.source_lang
141
+ temp = text_to_translate
142
+ text_to_translate = st.session_state.translation
143
+ st.session_state.translation = temp
144
+
145
  st.markdown('</div>', unsafe_allow_html=True)
146