whisper_transcribe / ui /lang_setting.py
chompionsawelo's picture
Huge changes
59e1d08
raw
history blame
2.84 kB
from ui.ui_component import *
def change_lang(input):
# Change language function
global current_ui_lang
current_ui_lang = get_ui_dict(input)
print(f"Change language to {available_ui_lang[input]}")
return [
# Top
top_markdown.update(
current_ui_lang["top_markdown"]),
input_url.update(
label=current_ui_lang["input_url_label"], info=current_ui_lang["input_url_info"]),
url_download_button.update(
current_ui_lang["download_button_value"]),
input_video.update(
label=current_ui_lang["input_video_label"]),
start_time.update(
label=current_ui_lang["start_time_label"]),
end_time.update(
label=current_ui_lang["end_time_label"]),
lang_radio.update(
choices=current_ui_lang["lang_radio_choices"], value=None, label=current_ui_lang["lang_radio_label"], info=current_ui_lang["lang_radio_info"],),
model_dropdown.update(
choices=current_ui_lang["model_dropdown_choices"], value=None, label=current_ui_lang["model_dropdown_label"], info=current_ui_lang["model_dropdown_info"]),
start_button.update(
current_ui_lang["start_button_value"]),
# Middle
middle_markdown.update(
current_ui_lang["middle_markdown"]),
adjust_speaker.update(
label=current_ui_lang["adjust_speaker_value"]),
prev_button.update(
current_ui_lang["prev_button_value"]),
next_button.update(
current_ui_lang["next_button_value"]),
adjust_button.update(
current_ui_lang["adjust_button_value"]),
# Bottom
bottom_markdown.update(
current_ui_lang["bottom_markdown"]),
output_video.update(
label=current_ui_lang["output_video_label"]),
download_video_subtitle_button.update(
current_ui_lang["download_video_button_value"]),
output_transcribe.update(
label=current_ui_lang["output_transcribe_label"]),
# Summary
summary_markdown.update(
current_ui_lang["summary_markdown"]),
summary_button.update(
current_ui_lang["summary_button_value"]),
output_summary.update(
label=current_ui_lang["output_summary_label"]),
]
# comp_to_update and change_lang return must always be equal
comp_to_update = [
top_markdown,
input_url,
url_download_button,
input_video,
start_time,
end_time,
lang_radio,
model_dropdown,
start_button,
middle_markdown,
adjust_speaker,
prev_button,
next_button,
adjust_button,
bottom_markdown,
output_video,
download_video_subtitle_button,
output_transcribe,
summary_markdown,
summary_button,
output_summary,
]