From c19e8c7a0a387532b6ddcc7f7f6009326c4ca7c4 Mon Sep 17 00:00:00 2001 From: if Date: Sat, 8 Apr 2023 13:03:08 +0300 Subject: [PATCH] rebuild structure --- chat.py | 15 +++++++++------ src/utils/lang.py | 3 +++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/chat.py b/chat.py index a39062c..470ec5e 100644 --- a/chat.py +++ b/chat.py @@ -98,14 +98,14 @@ if __name__ == "__main__": st.session_state.locale = en st.markdown(f"

{st.session_state.locale.title}

", unsafe_allow_html=True) st.markdown("---") - main() - st.markdown("---") - st.image(f"{img_dir}/{get_random_img(get_files_in_dir(img_dir))}") - st.markdown("---") selected_footer = option_menu( menu_title=None, - options=[st.session_state.locale.footer_option1, st.session_state.locale.footer_option2], - icons=["info-circle", "piggy-bank"], + options=[ + st.session_state.locale.footer_option1, + st.session_state.locale.footer_option0, + st.session_state.locale.footer_option2, + ], + icons=["info-circle", "", "piggy-bank"], menu_icon="cast", default_index=0, orientation="horizontal", @@ -113,7 +113,10 @@ if __name__ == "__main__": ) st.markdown("---") match selected_footer: + case st.session_state.locale.footer_option0: + main() case st.session_state.locale.footer_option1: + st.image(f"{img_dir}/{get_random_img(get_files_in_dir(img_dir))}") show_info(tg_svg) case st.session_state.locale.footer_option2: show_donates() diff --git a/src/utils/lang.py b/src/utils/lang.py index 13eb043..e01c2b5 100644 --- a/src/utils/lang.py +++ b/src/utils/lang.py @@ -29,6 +29,7 @@ class Locale: radio_text2: str stt_placeholder: str footer_title: str + footer_option0: str footer_option1: str footer_option2: str footer_chat: str @@ -63,6 +64,7 @@ class EnLocale(Locale): radio_text2: str = "Create" stt_placeholder: str = "To Hear The Voice Of AI Press Play" footer_title: str = "Support & Feedback" + footer_option0: str = "Chat" footer_option1: str = "Info" footer_option2: str = "Donates" footer_chat: str = "AI Talks Chat" @@ -106,6 +108,7 @@ class RuLocale(Locale): radio_text2: str = "Создать" stt_placeholder: str = "Чтобы Услышать ИИ Нажми Кнопку Проигрывателя" footer_title: str = "Поддержка и Обратная Связь" + footer_option0: str = "Чат" footer_option1: str = "Информация" footer_option2: str = "Задонатить" footer_chat: str = "Чат Разговорчики с ИИ"