Spaces:
Sleeping
Sleeping
Update modules/studentact/current_situation_interface.py
Browse files
modules/studentact/current_situation_interface.py
CHANGED
|
@@ -87,11 +87,11 @@ def display_current_situation_interface(lang_code, nlp_models, current_situation
|
|
| 87 |
with input_col:
|
| 88 |
# Text area con manejo de estado
|
| 89 |
text_input = st.text_area(
|
| 90 |
-
current_situation_t
|
| 91 |
height=400,
|
| 92 |
key="text_area",
|
| 93 |
value=st.session_state.text_input,
|
| 94 |
-
help=current_situation_t
|
| 95 |
)
|
| 96 |
|
| 97 |
# Funci贸n para manejar cambios de texto
|
|
@@ -100,13 +100,13 @@ def display_current_situation_interface(lang_code, nlp_models, current_situation
|
|
| 100 |
st.session_state.show_results = False
|
| 101 |
|
| 102 |
if st.button(
|
| 103 |
-
current_situation_t
|
| 104 |
type="primary",
|
| 105 |
disabled=not text_input.strip(),
|
| 106 |
use_container_width=True,
|
| 107 |
):
|
| 108 |
try:
|
| 109 |
-
with st.spinner(current_situation_t
|
| 110 |
doc = nlp_models[lang_code](text_input)
|
| 111 |
metrics = analyze_text_dimensions(doc)
|
| 112 |
|
|
@@ -126,20 +126,20 @@ def display_current_situation_interface(lang_code, nlp_models, current_situation
|
|
| 126 |
|
| 127 |
except Exception as e:
|
| 128 |
logger.error(f"Error en an谩lisis: {str(e)}")
|
| 129 |
-
st.error(current_situation_t
|
| 130 |
|
| 131 |
# Mostrar resultados en la columna derecha
|
| 132 |
with results_col:
|
| 133 |
if st.session_state.show_results and st.session_state.current_metrics is not None:
|
| 134 |
# Primero los radio buttons para tipo de texto
|
| 135 |
-
st.markdown(f"### {current_situation_t
|
| 136 |
text_type = st.radio(
|
| 137 |
"",
|
| 138 |
options=list(TEXT_TYPES.keys()),
|
| 139 |
format_func=lambda x: TEXT_TYPES[x]['name'],
|
| 140 |
horizontal=True,
|
| 141 |
key="text_type_radio",
|
| 142 |
-
help=current_situation_t
|
| 143 |
)
|
| 144 |
|
| 145 |
st.session_state.current_text_type = text_type
|
|
|
|
| 87 |
with input_col:
|
| 88 |
# Text area con manejo de estado
|
| 89 |
text_input = st.text_area(
|
| 90 |
+
current_situation_t('input_prompt'),
|
| 91 |
height=400,
|
| 92 |
key="text_area",
|
| 93 |
value=st.session_state.text_input,
|
| 94 |
+
help=current_situation_t('help')
|
| 95 |
)
|
| 96 |
|
| 97 |
# Funci贸n para manejar cambios de texto
|
|
|
|
| 100 |
st.session_state.show_results = False
|
| 101 |
|
| 102 |
if st.button(
|
| 103 |
+
current_situation_t('analyze_button'),
|
| 104 |
type="primary",
|
| 105 |
disabled=not text_input.strip(),
|
| 106 |
use_container_width=True,
|
| 107 |
):
|
| 108 |
try:
|
| 109 |
+
with st.spinner(current_situation_t('processing'):
|
| 110 |
doc = nlp_models[lang_code](text_input)
|
| 111 |
metrics = analyze_text_dimensions(doc)
|
| 112 |
|
|
|
|
| 126 |
|
| 127 |
except Exception as e:
|
| 128 |
logger.error(f"Error en an谩lisis: {str(e)}")
|
| 129 |
+
st.error(current_situation_t('analysis_error')
|
| 130 |
|
| 131 |
# Mostrar resultados en la columna derecha
|
| 132 |
with results_col:
|
| 133 |
if st.session_state.show_results and st.session_state.current_metrics is not None:
|
| 134 |
# Primero los radio buttons para tipo de texto
|
| 135 |
+
st.markdown(f"### {current_situation_t('text_type_header')}")
|
| 136 |
text_type = st.radio(
|
| 137 |
"",
|
| 138 |
options=list(TEXT_TYPES.keys()),
|
| 139 |
format_func=lambda x: TEXT_TYPES[x]['name'],
|
| 140 |
horizontal=True,
|
| 141 |
key="text_type_radio",
|
| 142 |
+
help=current_situation_t('text_type_help')
|
| 143 |
)
|
| 144 |
|
| 145 |
st.session_state.current_text_type = text_type
|