Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
selfitcamera
commited on
Commit
·
d21b31a
1
Parent(s):
348f097
init
Browse files
app.py
CHANGED
|
@@ -1356,43 +1356,53 @@ def create_app():
|
|
| 1356 |
]
|
| 1357 |
|
| 1358 |
def update_ui_lang(lang):
|
| 1359 |
-
|
| 1360 |
-
|
| 1361 |
-
|
| 1362 |
-
<
|
| 1363 |
-
|
| 1364 |
-
|
| 1365 |
-
|
| 1366 |
-
|
| 1367 |
-
|
| 1368 |
-
|
| 1369 |
-
|
| 1370 |
-
|
| 1371 |
-
|
| 1372 |
-
|
| 1373 |
-
|
| 1374 |
-
|
| 1375 |
-
|
| 1376 |
-
|
| 1377 |
-
|
| 1378 |
-
|
| 1379 |
-
|
| 1380 |
-
|
| 1381 |
-
|
| 1382 |
-
|
| 1383 |
-
|
| 1384 |
-
|
| 1385 |
-
|
| 1386 |
-
|
| 1387 |
-
|
| 1388 |
-
|
| 1389 |
-
|
| 1390 |
-
|
| 1391 |
-
|
| 1392 |
-
|
| 1393 |
-
|
| 1394 |
-
|
| 1395 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1396 |
|
| 1397 |
def on_lang_change(lang):
|
| 1398 |
return lang, *update_ui_lang(lang).values()
|
|
|
|
| 1356 |
]
|
| 1357 |
|
| 1358 |
def update_ui_lang(lang):
|
| 1359 |
+
if lang in ["hi", "ru", "zh"]:
|
| 1360 |
+
return {
|
| 1361 |
+
header_title: gr.update(value=f"""
|
| 1362 |
+
<div style="text-align: center; margin: 20px auto 10px auto; max-width: 800px;">
|
| 1363 |
+
<h1 style="color: #2c3e50; margin: 0; font-size: 3.5em; font-weight: 800; letter-spacing: 3px; text-shadow: 2px 2px 4px rgba(0,0,0,0.1);">
|
| 1364 |
+
{t('header_title', lang)}
|
| 1365 |
+
</h1>
|
| 1366 |
+
</div>"""),
|
| 1367 |
+
}
|
| 1368 |
+
else:
|
| 1369 |
+
return {
|
| 1370 |
+
header_title: gr.update(value=f"""
|
| 1371 |
+
<div style="text-align: center; margin: 20px auto 10px auto; max-width: 800px;">
|
| 1372 |
+
<h1 style="color: #2c3e50; margin: 0; font-size: 3.5em; font-weight: 800; letter-spacing: 3px; text-shadow: 2px 2px 4px rgba(0,0,0,0.1);">
|
| 1373 |
+
{t('header_title', lang)}
|
| 1374 |
+
</h1>
|
| 1375 |
+
</div>"""),
|
| 1376 |
+
news_banner: gr.update(value=f"""
|
| 1377 |
+
<style>
|
| 1378 |
+
@keyframes breathe {{ 0%, 100% {{ transform: scale(1); }} 50% {{ transform: scale(1.02); }} }}
|
| 1379 |
+
.breathing-banner {{ animation: breathe 3s ease-in-out infinite; }}
|
| 1380 |
+
</style>
|
| 1381 |
+
<div class="breathing-banner" style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); margin: 5px auto 5px auto; padding: 6px 40px; border-radius: 20px; max-width: 800px; box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3); text-align: center;">
|
| 1382 |
+
<span style="color: white; font-weight: 600; font-size: 1.0em;">
|
| 1383 |
+
🎉 NEW:
|
| 1384 |
+
<a href="https://huggingface.co/spaces/Selfit/Multi-Image-Edit" target="_blank" style="color: white; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.5); transition: all 0.3s ease; margin: 0 8px;" onmouseover="this.style.borderBottom='1px solid white'" onmouseout="this.style.borderBottom='1px solid rgba(255,255,255,0.5)'">
|
| 1385 |
+
Multi-Image-Edit
|
| 1386 |
+
</a>
|
| 1387 |
+
|
|
| 1388 |
+
<a href="https://huggingface.co/spaces/Selfit/Text-to-Image-Pro" target="_blank" style="color: white; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.5); transition: all 0.3s ease; margin: 0 8px;" onmouseover="this.style.borderBottom='1px solid white'" onmouseout="this.style.borderBottom='1px solid rgba(255,255,255,0.5)'">
|
| 1389 |
+
Text-to-Image
|
| 1390 |
+
</a>
|
| 1391 |
+
</span>
|
| 1392 |
+
</div>"""),
|
| 1393 |
+
global_tab: gr.update(label=t("global_editor_tab", lang)),
|
| 1394 |
+
upload_image_header: gr.update(value=t("upload_image_header", lang)),
|
| 1395 |
+
input_image: gr.update(label=t("upload_image_label", lang)),
|
| 1396 |
+
editing_instructions_header: gr.update(value=t("editing_instructions_header", lang)),
|
| 1397 |
+
prompt_input: gr.update(label=t("prompt_input_label", lang), placeholder=t("prompt_input_placeholder", lang)),
|
| 1398 |
+
edit_button: gr.update(value=t("start_editing_button", lang)),
|
| 1399 |
+
editing_result_header: gr.update(value=t("editing_result_header", lang)),
|
| 1400 |
+
output_image: gr.update(label=t("output_image_label", lang)),
|
| 1401 |
+
use_as_input_btn: gr.update(value=t("use_as_input_button", lang)),
|
| 1402 |
+
status_output: gr.update(label=t("status_output_label", lang)),
|
| 1403 |
+
prompt_examples_header: gr.update(value=t("prompt_examples_header", lang)),
|
| 1404 |
+
seo_html: gr.update(value=get_seo_html(lang)),
|
| 1405 |
+
}
|
| 1406 |
|
| 1407 |
def on_lang_change(lang):
|
| 1408 |
return lang, *update_ui_lang(lang).values()
|