Translate the menu from Danish to English
Only to be used internally, in the future.
This commit is contained in:
parent
8d49e24ed3
commit
beb88558ac
|
@ -1,2 +1,3 @@
|
||||||
browser-cookie3==0.17.0
|
browser-cookie3==0.17.0
|
||||||
|
googletrans==4.0.0rc1
|
||||||
requests==2.28.2
|
requests==2.28.2
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
## Improve the post by including a photo of the menu.
|
## Improve the post by including a photo of the menu.
|
||||||
Requirements:
|
Requirements:
|
||||||
[ ] Ask Google Translate to translate menu from Danish to English.
|
[x] Ask Google Translate to translate menu from Danish to English.
|
||||||
[ ] Ask Crayion to generate images of the menu in English.
|
[ ] Ask Crayion to generate images of the menu in English.
|
||||||
[ ] Include a random image from the Crayion results as an attachment in
|
[ ] Include a random image from the Crayion results as an attachment in
|
||||||
the Slack post.
|
the Slack post.
|
||||||
|
|
5
slack.py
5
slack.py
|
@ -12,6 +12,7 @@ import random
|
||||||
from urllib import error, parse, request
|
from urllib import error, parse, request
|
||||||
|
|
||||||
import browser_cookie3
|
import browser_cookie3
|
||||||
|
from googletrans import Translator
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
|
||||||
|
@ -78,6 +79,10 @@ else:
|
||||||
menu = menu["Menutekst"]
|
menu = menu["Menutekst"]
|
||||||
sys.stdout.write(f"The menu of today ({today}) is: {menu}\n")
|
sys.stdout.write(f"The menu of today ({today}) is: {menu}\n")
|
||||||
|
|
||||||
|
# Translate menu from Danish to English.
|
||||||
|
translation = Translator().translate(menu, src="da", dest="en").text
|
||||||
|
sys.stdout.write(f"English translation of the menu is: {translation}\n")
|
||||||
|
|
||||||
# Determine appropriate emojis for the menu.
|
# Determine appropriate emojis for the menu.
|
||||||
emojis = []
|
emojis = []
|
||||||
for emoji, keywords in {
|
for emoji, keywords in {
|
||||||
|
|
Loading…
Reference in a new issue