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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -99,6 +99,16 @@ col1, col_swap, col2 = st.columns([1, 0.05, 1], gap="small")
99
  if "translation" not in st.session_state:
100
  st.session_state.translation = "Traduction"
101
 
 
 
 
 
 
 
 
 
 
 
102
  with col1:
103
  st.markdown('<h3 class="col-container">'+st.session_state.source_lang+'</h3>', unsafe_allow_html=True)
104
  text_to_translate = st.text_area(
@@ -132,15 +142,6 @@ with col2:
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
 
 
99
  if "translation" not in st.session_state:
100
  st.session_state.translation = "Traduction"
101
 
102
+ with col_swap:
103
+ st.write("")
104
+ swap = st.button("⇄")
105
+
106
+ if swap:
107
+ st.session_state.source_lang, st.session_state.target_lang = st.session_state.target_lang, st.session_state.source_lang
108
+ temp = text_to_translate
109
+ text_to_translate = st.session_state.translation
110
+ st.session_state.translation = temp
111
+
112
  with col1:
113
  st.markdown('<h3 class="col-container">'+st.session_state.source_lang+'</h3>', unsafe_allow_html=True)
114
  text_to_translate = st.text_area(
 
142
  height=200
143
  )
144
 
 
 
 
 
 
 
 
 
 
145
 
146
  st.markdown('</div>', unsafe_allow_html=True)
147