do it like this
Browse files
app.py
CHANGED
@@ -35,13 +35,14 @@ def filter_languages(search_text, selected_languages):
|
|
35 |
if not filtered:
|
36 |
filtered = ["No match found..."]
|
37 |
else:
|
38 |
-
filtered = [filtered[0] + "..."] + filtered
|
39 |
|
40 |
return gr.update(choices=filtered), filtered[0] # Keep dropdown open and selectable
|
41 |
|
42 |
def add_language(selected_language, selected_languages):
|
43 |
if not selected_language:
|
44 |
return selected_languages
|
|
|
45 |
selected_list = selected_languages.split(",") if selected_languages else []
|
46 |
selected_list = list(set(selected_list) & set(languages.get_all_supported_languages()))
|
47 |
if selected_language not in selected_list:
|
|
|
35 |
if not filtered:
|
36 |
filtered = ["No match found..."]
|
37 |
else:
|
38 |
+
filtered = [filtered[0] + "..."] + filtered[1:]
|
39 |
|
40 |
return gr.update(choices=filtered), filtered[0] # Keep dropdown open and selectable
|
41 |
|
42 |
def add_language(selected_language, selected_languages):
|
43 |
if not selected_language:
|
44 |
return selected_languages
|
45 |
+
selected_language = selected_language.rstrip("...")
|
46 |
selected_list = selected_languages.split(",") if selected_languages else []
|
47 |
selected_list = list(set(selected_list) & set(languages.get_all_supported_languages()))
|
48 |
if selected_language not in selected_list:
|