diff --git a/cookbook/helper/recipe_url_import.py b/cookbook/helper/recipe_url_import.py index 65e579675..19c55b83c 100644 --- a/cookbook/helper/recipe_url_import.py +++ b/cookbook/helper/recipe_url_import.py @@ -3,6 +3,7 @@ import re from html import unescape from unicodedata import decomposition +from django.utils.translation import gettext as _ from django.utils.dateparse import parse_duration from isodate import parse_duration as iso_parse_duration from isodate.isoerror import ISO8601Error @@ -147,7 +148,7 @@ def get_from_scraper(scrape, request): if scrape.url: recipe_json['url'] = scrape.url - recipe_json['recipeInstructions'] += "\n\nImported from " + scrape.url + recipe_json['recipeInstructions'] += "\n\n" + _("Imported from") + ": " + scrape.url return recipe_json diff --git a/cookbook/integration/copymethat.py b/cookbook/integration/copymethat.py index 3bb9cd5ce..c961a51a5 100644 --- a/cookbook/integration/copymethat.py +++ b/cookbook/integration/copymethat.py @@ -4,6 +4,7 @@ from zipfile import ZipFile from bs4 import BeautifulSoup +from django.utils.translation import gettext as _ from cookbook.helper.ingredient_parser import IngredientParser from cookbook.helper.recipe_html_import import get_recipe_from_source from cookbook.helper.recipe_url_import import iso_duration_to_minutes, parse_servings @@ -60,7 +61,7 @@ class CopyMeThat(Integration): try: if file.find("a", {"id": "original_link"}).text != '': - step.instruction += "\n\nImported from: " + file.find("a", {"id": "original_link"}).text + step.instruction += "\n\n" + _("Imported from") + ": " + file.find("a", {"id": "original_link"}).text step.save() except AttributeError: pass diff --git a/cookbook/integration/recettetek.py b/cookbook/integration/recettetek.py index 5bc171e0e..7eb93a8e9 100644 --- a/cookbook/integration/recettetek.py +++ b/cookbook/integration/recettetek.py @@ -6,6 +6,7 @@ from zipfile import ZipFile import requests +from django.utils.translation import gettext as _ from cookbook.helper.image_processing import get_filetype from cookbook.helper.ingredient_parser import IngredientParser from cookbook.integration.integration import Integration @@ -49,7 +50,7 @@ class RecetteTek(Integration): # Append the original import url to the step (if it exists) try: if file['url'] != '': - step.instruction += '\n\nImported from: ' + file['url'] + step.instruction += '\n\n' + _('Imported from') + ': ' + file['url'] step.save() except Exception as e: print(recipe.name, ': failed to import source url ', str(e)) diff --git a/cookbook/integration/recipekeeper.py b/cookbook/integration/recipekeeper.py index 59a04098a..31cc326f9 100644 --- a/cookbook/integration/recipekeeper.py +++ b/cookbook/integration/recipekeeper.py @@ -4,6 +4,7 @@ from zipfile import ZipFile from bs4 import BeautifulSoup +from django.utils.translation import gettext as _ from cookbook.helper.ingredient_parser import IngredientParser from cookbook.helper.recipe_url_import import iso_duration_to_minutes, parse_servings from cookbook.integration.integration import Integration @@ -59,7 +60,7 @@ class RecipeKeeper(Integration): step.instruction += s.text + ' \n' if file.find("span", {"itemprop": "recipeSource"}).text != '': - step.instruction += "\n\nImported from: " + file.find("span", {"itemprop": "recipeSource"}).text + step.instruction += "\n\n" + _("Imported from") + ": " + file.find("span", {"itemprop": "recipeSource"}).text step.save() recipe.steps.add(step) diff --git a/cookbook/templates/url_import.html b/cookbook/templates/url_import.html index 88cc29273..6c82b27d9 100644 --- a/cookbook/templates/url_import.html +++ b/cookbook/templates/url_import.html @@ -30,7 +30,7 @@ style="height:50%" href="{% bookmarklet request %}" title="{% trans 'Drag me to your bookmarks to import recipes from anywhere' %}"> - {% trans 'Bookmark Me!' %} + {% trans 'Bookmark Me!' %}