This commit is contained in:
Wolfang Torres
2026-06-20 10:19:59 +08:00
parent 62588298a8
commit a23e0dc34e

View File

@@ -5,9 +5,9 @@ from pathlib import Path
# Local
from .api import (
pre_process_a_dictionary_file,
is_file,
list_input_files,
pre_process_a_dictionary_file,
process_a_dictionary_file,
process_a_phrases_file,
select_file,
@@ -56,13 +56,16 @@ def cli_select_language(languages: list = None) -> str:
}
else:
avaliable_languages = LANGUAGES.LanguageNames.items()
if not avaliable_languages:
raise ValueError("""No languages are avaliable,
if this is a dictionay file, you must preprocess it first""")
print("Select a language:")
for language_id, language in avaliable_languages:
for language_id, language in avaliable_languages.items():
if languages and language_id in languages:
print(f"{language_id} - {language}")
s = None
while not s or s not in LANGUAGES.AvailableLanguages:
s = input(f"Please select the language {LANGUAGES.AvailableLanguages}: ")
s = input(f"Please select the language {avaliable_languages.keys()}: ")
return s