add translations, go back to using scraper.instructions()
This commit is contained in:
parent
f43ef3ad59
commit
bce44866c2
@ -138,7 +138,7 @@ def get_from_scraper(scrape, request):
|
|||||||
|
|
||||||
recipe_json['steps'] = []
|
recipe_json['steps'] = []
|
||||||
try:
|
try:
|
||||||
for i in parse_instructions(scrape.instructions_list()):
|
for i in parse_instructions(scrape.instructions()):
|
||||||
recipe_json['steps'].append({'instruction': i, 'ingredients': [], })
|
recipe_json['steps'].append({'instruction': i, 'ingredients': [], })
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
@ -245,7 +245,13 @@ def parse_description(description):
|
|||||||
|
|
||||||
|
|
||||||
def clean_instruction_string(instruction):
|
def clean_instruction_string(instruction):
|
||||||
normalized_string = normalize_string(instruction)
|
# handle HTML tags that can be converted to markup
|
||||||
|
normalized_string = instruction \
|
||||||
|
.replace("<nobr>", "**") \
|
||||||
|
.replace("</nobr>", "**") \
|
||||||
|
.replace("<strong>", "**") \
|
||||||
|
.replace("</strong>", "**")
|
||||||
|
normalized_string = normalize_string(normalized_string)
|
||||||
normalized_string = normalized_string.replace('\n', ' \n')
|
normalized_string = normalized_string.replace('\n', ' \n')
|
||||||
normalized_string = normalized_string.replace(' \n \n', '\n\n')
|
normalized_string = normalized_string.replace(' \n \n', '\n\n')
|
||||||
|
|
||||||
@ -253,16 +259,13 @@ def clean_instruction_string(instruction):
|
|||||||
# that happen in nearly every recipe on Cookidoo, Zaubertopf Club, Rezeptwelt
|
# that happen in nearly every recipe on Cookidoo, Zaubertopf Club, Rezeptwelt
|
||||||
# and in Thermomix-specific recipes on many other sites
|
# and in Thermomix-specific recipes on many other sites
|
||||||
return normalized_string \
|
return normalized_string \
|
||||||
.replace("<nobr>", "**") \
|
.replace("", _('reverse rotation')) \
|
||||||
.replace("</nobr>", "**") \
|
.replace("", _('careful rotation')) \
|
||||||
.replace("", _('Linkslauf')) \
|
.replace("", _('knead')) \
|
||||||
.replace("", _('Kochlöffel')) \
|
.replace("Andicken ", _('thicken')) \
|
||||||
.replace("", _('Kneten')) \
|
.replace("Erwärmen ", _('warm up')) \
|
||||||
.replace("Andicken ", _('Andicken')) \
|
.replace("Fermentieren ", _('ferment')) \
|
||||||
.replace("Erwärmen ", _('Erwärmen')) \
|
.replace("Sous-vide ", _("sous-vide"))
|
||||||
.replace("Fermentieren ", _('Fermentieren')) \
|
|
||||||
.replace("Rühraufsatz einsetzen", "**Rühraufsatz einsetzen**") \
|
|
||||||
.replace("Rühraufsatz entfernen", "**Rühraufsatz entfernen**")
|
|
||||||
|
|
||||||
|
|
||||||
def parse_instructions(instructions):
|
def parse_instructions(instructions):
|
||||||
|
@ -542,6 +542,35 @@ msgstr "Du hast mehr Benutzer in Deinem Space als erlaubt."
|
|||||||
msgid "One of queryset or hash_key must be provided"
|
msgid "One of queryset or hash_key must be provided"
|
||||||
msgstr "Es muss die Abfrage oder der Hash_Key angeben werden"
|
msgstr "Es muss die Abfrage oder der Hash_Key angeben werden"
|
||||||
|
|
||||||
|
#: .\cookbook\helper\recipe_url_import.py:265
|
||||||
|
msgid "reverse rotation"
|
||||||
|
msgstr "Linkslauf"
|
||||||
|
|
||||||
|
#: .\cookbook\helper\recipe_url_import.py:266
|
||||||
|
msgid "careful rotation"
|
||||||
|
msgstr "Kochlöffel"
|
||||||
|
|
||||||
|
#: .\cookbook\helper\recipe_url_import.py:267
|
||||||
|
msgid "knead"
|
||||||
|
msgstr "Kneten"
|
||||||
|
|
||||||
|
#: .\cookbook\helper\recipe_url_import.py:268
|
||||||
|
msgid "thicken"
|
||||||
|
msgstr "Andicken"
|
||||||
|
|
||||||
|
#: .\cookbook\helper\recipe_url_import.py:269
|
||||||
|
msgid "warm up"
|
||||||
|
msgstr "Erwärmen"
|
||||||
|
|
||||||
|
#: .\cookbook\helper\recipe_url_import.py:270
|
||||||
|
msgid "ferment"
|
||||||
|
msgstr "Fermentieren"
|
||||||
|
|
||||||
|
#: .\cookbook\helper\recipe_url_import.py:271
|
||||||
|
msgid "sous-vide"
|
||||||
|
msgstr "Sous-vide"
|
||||||
|
|
||||||
|
|
||||||
#: .\cookbook\helper\shopping_helper.py:152
|
#: .\cookbook\helper\shopping_helper.py:152
|
||||||
msgid "You must supply a servings size"
|
msgid "You must supply a servings size"
|
||||||
msgstr "Sie müssen eine Portionsgröße angeben"
|
msgstr "Sie müssen eine Portionsgröße angeben"
|
||||||
|
Loading…
Reference in New Issue
Block a user