1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-12-18 08:27:03 +02:00

remove use of deprecated method

This commit is contained in:
dingedi 2022-09-17 08:45:59 +02:00
parent 7b7cd7768b
commit 13d792b6b6
No known key found for this signature in database
GPG Key ID: EE23A12D271A3CED

View File

@ -21,7 +21,7 @@ def check_and_install_models(force=False, load_only_lang_codes=None):
package.update_package_index() package.update_package_index()
# Load available packages from local package index # Load available packages from local package index
available_packages = package.load_available_packages() available_packages = package.get_available_packages()
print("Found %s models" % len(available_packages)) print("Found %s models" % len(available_packages))
if load_only_lang_codes is not None: if load_only_lang_codes is not None:
@ -55,10 +55,10 @@ def check_and_install_models(force=False, load_only_lang_codes=None):
package.install_from_path(download_path) package.install_from_path(download_path)
# reload installed languages # reload installed languages
app.language.languages = translate.load_installed_languages() app.language.languages = translate.get_installed_languages()
print( print(
"Loaded support for %s languages (%s models total)!" "Loaded support for %s languages (%s models total)!"
% (len(translate.load_installed_languages()), len(available_packages)) % (len(translate.get_installed_languages()), len(available_packages))
) )