Takes in a list of output-languages, and a list of input-words (in English) and creates pngs with the translations
Written in Python3, using Pillow for images. Kivy for UI. Uses Microsoft Cognitive Services for the translation.
Created with input from a Seattle organization - currently in use by them.
Created images look something like this: "We have been LOVING your translation tool-- it's so useful! We got a donation of various baking powders (flour, batter, corn starch, etc) and it has been so easy for me to make a batch of signs really quickly. When the food bank distributes unlabeled food, we have to include a card with the food type on it so I have also used the tool to make quarter-page printouts of the foods. This has saved so much time and made PMFB a much more equitable and accessible place-- thank you!!" - Jill Weidman Hello! Thanks for your interest. If you're an organization, then please contact me via hello @ bethcrane . com I can create an app package for you and assist you in setting up the subscription keys.- Python 3
- Pillow (for creating images)
- OpenPyXL (for interacting with spreadsheets)
- Requests (for the bing image search code to work)
- Kivy (for the UI)
- Pytest (for testing)
- An azure subscription key to use the Bing translator api
- An azure subscription key to use Bing image search
- Install kivy
- Run
python3 main.py
- Ensure you have a folder called output/foodThumbnails and one called output/images (where output is a sibling dir or src).
- Run
python3 getLanguageCodes.py
(I've included the results here in languageCodes.txt) to see the language codes available- Modify the input/toLanguages.txt file to include whichever languages you desire
- Modify the input/words.txt file to include the words you'd like to translate
- Create a file called subscriptionKeys/translatorSubscriptionKey.txt and enter your azure translation subscription key in
- Run
python3 wordTranslator.py
- this will open the words.txt and toLanguages.txt files and output a spreadsheet of translations for each word- Open the spreadsheet output/translatedWords.xlsx
- Modify any translations you like
- Run
python3 imageDownloader.py
- this will open the spreadsheet and download an image for each english word- Open the foodThumbnails folder and check the images. If any images aren't suitable, replace them with new ones of the same name
- Run
python3 finalImageCreator.py
- this will open the spreadsheet and output an image for each word, with the translations + thumbnail image- Currently expects a newline at the start of the toLanguages file
- Currently assumes foodThumbnails images are max 512x512 and with the same name (+casing) as the english word in the spreadsheet
- The main app assumes there are 4 languages (1 input + 3 output)