rebuild structure

This commit is contained in:
if 2023-04-08 13:03:08 +03:00
parent 9c684fb129
commit c19e8c7a0a
2 changed files with 12 additions and 6 deletions

15
chat.py
View File

@ -98,14 +98,14 @@ if __name__ == "__main__":
st.session_state.locale = en st.session_state.locale = en
st.markdown(f"<h1 style='text-align: center;'>{st.session_state.locale.title}</h1>", unsafe_allow_html=True) st.markdown(f"<h1 style='text-align: center;'>{st.session_state.locale.title}</h1>", unsafe_allow_html=True)
st.markdown("---") 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( selected_footer = option_menu(
menu_title=None, menu_title=None,
options=[st.session_state.locale.footer_option1, st.session_state.locale.footer_option2], options=[
icons=["info-circle", "piggy-bank"], 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", menu_icon="cast",
default_index=0, default_index=0,
orientation="horizontal", orientation="horizontal",
@ -113,7 +113,10 @@ if __name__ == "__main__":
) )
st.markdown("---") st.markdown("---")
match selected_footer: match selected_footer:
case st.session_state.locale.footer_option0:
main()
case st.session_state.locale.footer_option1: 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) show_info(tg_svg)
case st.session_state.locale.footer_option2: case st.session_state.locale.footer_option2:
show_donates() show_donates()

View File

@ -29,6 +29,7 @@ class Locale:
radio_text2: str radio_text2: str
stt_placeholder: str stt_placeholder: str
footer_title: str footer_title: str
footer_option0: str
footer_option1: str footer_option1: str
footer_option2: str footer_option2: str
footer_chat: str footer_chat: str
@ -63,6 +64,7 @@ class EnLocale(Locale):
radio_text2: str = "Create" radio_text2: str = "Create"
stt_placeholder: str = "To Hear The Voice Of AI Press Play" stt_placeholder: str = "To Hear The Voice Of AI Press Play"
footer_title: str = "Support & Feedback" footer_title: str = "Support & Feedback"
footer_option0: str = "Chat"
footer_option1: str = "Info" footer_option1: str = "Info"
footer_option2: str = "Donates" footer_option2: str = "Donates"
footer_chat: str = "AI Talks Chat" footer_chat: str = "AI Talks Chat"
@ -106,6 +108,7 @@ class RuLocale(Locale):
radio_text2: str = "Создать" radio_text2: str = "Создать"
stt_placeholder: str = "Чтобы Услышать ИИ Нажми Кнопку Проигрывателя" stt_placeholder: str = "Чтобы Услышать ИИ Нажми Кнопку Проигрывателя"
footer_title: str = "Поддержка и Обратная Связь" footer_title: str = "Поддержка и Обратная Связь"
footer_option0: str = "Чат"
footer_option1: str = "Информация" footer_option1: str = "Информация"
footer_option2: str = "Задонатить" footer_option2: str = "Задонатить"
footer_chat: str = "Чат Разговорчики с ИИ" footer_chat: str = "Чат Разговорчики с ИИ"