In the imagetranslation.py, we can pass which translation API we want to use. Currently our program should support 2 APIs for production level and 1 APIs for development
Production level APIs are
Google Translation API
Amazon Translate API
Development level APIs are
Python Unofficial Google Translate
In the translate function, we can pass in translation service in a string as follows
translate(image, translation_service=""
The default is always the python-googletrans as it doesn't need credentials.
When the translation service is not python google translate, we need to look for proper API credentials in order for it to work properly.
Therefore we need to do the following:
[ ] Validate if the passed translation service is supported
[ ] If the passed translation service is one of Production level APIs, we need to look for proper credentials in some sort of .config file
[ ] Fallback should be python google translate if credentials was not found, or if passed translation service is not supported. However, it should warn the user that the fallback was used and why it happened.
In the
imagetranslation.py
, we can pass which translation API we want to use. Currently our program should support 2 APIs for production level and 1 APIs for developmentProduction level APIs are
Development level APIs are
In the
translate
function, we can pass in translation service in a string as followstranslate(image, translation_service=""
The default is always the
python-googletrans
as it doesn't need credentials.When the translation service is not python google translate, we need to look for proper API credentials in order for it to work properly.
Therefore we need to do the following:
.config
filepython google translate
if credentials was not found, or if passed translation service is not supported. However, it should warn the user that the fallback was used and why it happened.