argos-translate
argos-translate copied to clipboard
The en to zh translation is not working
import argostranslate.package
import argostranslate.translate
from_code = "en"
to_code = "zh"
argostranslate.package.update_package_index()
available_packages = argostranslate.package.get_available_packages()
package_to_install = next(
filter(
lambda x: x.from_code == from_code and x.to_code == to_code, available_packages
)
)
argostranslate.package.install_from_path(package_to_install.download())
# Translate
translatedText = argostranslate.translate.translate("Hello World", from_code, to_code)
print(translatedText)
# '¡Hola Mundo!'
It will still return 'Hello World'