Update app.py
Browse files
app.py
CHANGED
@@ -199,6 +199,7 @@ def update_translations(file, edited_table):
|
|
199 |
except Exception as e:
|
200 |
raise ValueError(f"Error updating translations: {e}")
|
201 |
|
|
|
202 |
def upload_and_manage(file, language):
|
203 |
if file is None:
|
204 |
return None, [], None, "No file uploaded. Please upload a video/audio file."
|
@@ -241,12 +242,36 @@ def upload_and_manage(file, language):
|
|
241 |
# Gradio Interface with Tabs
|
242 |
def build_interface():
|
243 |
css = """
|
|
|
244 |
.dataframe-container tr {
|
245 |
-
height: 50px !important;
|
246 |
}
|
|
|
|
|
247 |
.dataframe-container td {
|
248 |
-
white-space: normal !important;
|
249 |
-
word-break: break-word !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
}
|
251 |
"""
|
252 |
with gr.Blocks(css=css) as demo:
|
|
|
199 |
except Exception as e:
|
200 |
raise ValueError(f"Error updating translations: {e}")
|
201 |
|
202 |
+
|
203 |
def upload_and_manage(file, language):
|
204 |
if file is None:
|
205 |
return None, [], None, "No file uploaded. Please upload a video/audio file."
|
|
|
242 |
# Gradio Interface with Tabs
|
243 |
def build_interface():
|
244 |
css = """
|
245 |
+
/* Adjust row height */
|
246 |
.dataframe-container tr {
|
247 |
+
height: 50px !important;
|
248 |
}
|
249 |
+
|
250 |
+
/* Ensure text wrapping and prevent overflow */
|
251 |
.dataframe-container td {
|
252 |
+
white-space: normal !important;
|
253 |
+
word-break: break-word !important;
|
254 |
+
}
|
255 |
+
|
256 |
+
/* Set column widths */
|
257 |
+
[data-testid="block-container"] .scrolling-dataframe th:nth-child(1),
|
258 |
+
[data-testid="block-container"] .scrolling-dataframe td:nth-child(1) {
|
259 |
+
width: 10%; /* Start column */
|
260 |
+
}
|
261 |
+
|
262 |
+
[data-testid="block-container"] .scrolling-dataframe th:nth-child(2),
|
263 |
+
[data-testid="block-container"] .scrolling-dataframe td:nth-child(2) {
|
264 |
+
width: 35%; /* Original text */
|
265 |
+
}
|
266 |
+
|
267 |
+
[data-testid="block-container"] .scrolling-dataframe th:nth-child(3),
|
268 |
+
[data-testid="block-container"] .scrolling-dataframe td:nth-child(3) {
|
269 |
+
width: 35%; /* Translated text */
|
270 |
+
}
|
271 |
+
|
272 |
+
[data-testid="block-container"] .scrolling-dataframe th:nth-child(4),
|
273 |
+
[data-testid="block-container"] .scrolling-dataframe td:nth-child(4) {
|
274 |
+
width: 20%; /* End column */
|
275 |
}
|
276 |
"""
|
277 |
with gr.Blocks(css=css) as demo:
|