fix locales

This commit is contained in:
if 2023-04-02 00:37:20 +03:00
parent 4ad96c3fc1
commit 91360c984c
2 changed files with 22 additions and 9 deletions

10
chat.py
View File

@ -62,12 +62,16 @@ def main() -> None:
c1, c2, c3 = st.columns(3)
with c1, c2:
c1.selectbox(label=st.session_state.locale.select_placeholder1, key="model", options=AI_MODEL_OPTIONS)
role_kind = c2.radio("Role Kind", ("Select", "Create"), horizontal=True)
role_kind = c2.radio(
label=st.session_state.locale.radio_placeholder,
options=(st.session_state.locale.radio_text1, st.session_state.locale.radio_text2),
horizontal=True,
)
match role_kind:
case "Select":
case st.session_state.locale.radio_text1:
c3.selectbox(label=st.session_state.locale.select_placeholder2, key="role",
options=st.session_state.locale.ai_role_options)
case "Create":
case st.session_state.locale.radio_text2:
c3.text_input(label=st.session_state.locale.select_placeholder3, key="role")
get_user_input()

View File

@ -20,6 +20,9 @@ class Locale:
select_placeholder1: str
select_placeholder2: str
select_placeholder3: str
radio_placeholder: str
radio_text1: str
radio_text2: str
stt_placeholder: str
footer_title: str
footer_option1: str
@ -42,9 +45,12 @@ class EnLocale(Locale):
chat_run_btn: str = "Run"
chat_clear_btn: str = "Clear"
chat_save_btn: str = "Save"
select_placeholder1: str = "Select AI Model"
select_placeholder2: str = "Select AI Role"
select_placeholder3: str = "Create AI Role"
select_placeholder1: str = "Select Model"
select_placeholder2: str = "Select Role"
select_placeholder3: str = "Create Role"
radio_placeholder: str = "Role Interaction"
radio_text1: str = "Select"
radio_text2: str = "Create"
stt_placeholder: str = "To Hear The Voice Of AI Press Play"
footer_title: str = "Support & Feedback"
footer_option1: str = "Info"
@ -67,9 +73,12 @@ class RuLocale(Locale):
chat_run_btn: str = "Запустить"
chat_clear_btn: str = "Очистить"
chat_save_btn: str = "Сохранить"
select_placeholder1: str = "Выберите Модель ИИ"
select_placeholder2: str = "Выберите Роль ИИ"
select_placeholder3: str = "Создайте Роль ИИ"
select_placeholder1: str = "Выберите Модель"
select_placeholder2: str = "Выберите Роль"
select_placeholder3: str = "Создайте Роль"
radio_placeholder: str = "Взаимодествие с Ролью"
radio_text1: str = "Выбрать"
radio_text2: str = "Создать"
stt_placeholder: str = "Чтобы Услышать ИИ Нажми Кнопку Проигрывателя"
footer_title: str = "Поддержка и Обратная Связь"
footer_option1: str = "Информация"