diff --git a/frontend/lang/messages/en-US.json b/frontend/lang/messages/en-US.json index 47c2e41e8b80..84a7e45da67e 100644 --- a/frontend/lang/messages/en-US.json +++ b/frontend/lang/messages/en-US.json @@ -585,7 +585,21 @@ "screen-awake": "Keep Screen Awake", "remove-image": "Remove image", "nextStep": "Next step", - "recipe-actions": "Recipe Actions" + "recipe-actions": "Recipe Actions", + "parser": { + "experimental-alert-text": "Mealie uses natural language processing to parse and create units and food items for your recipe ingredients. This feature is experimental and may not always work as expected. If you prefer not to use the parsed results, you can select 'Cancel' and your changes will not be saved.", + "ingredient-parser": "Ingredient Parser", + "explanation": "To use the ingredient parser, click the 'Parse All' button to start the process. Once the processed ingredients are available, you can review the items and verify that they were parsed correctly. The model's confidence score is displayed on the right of the item title. This score is an average of all the individual scores and may not always be completely accurate.", + "alerts-explainer": "Alerts will be displayed if a matching foods or unit is found but does not exists in the database.", + "select-parser": "Select Parser", + "natural-language-processor": "Natural Language Processor", + "brute-parser": "Brute Parser", + "parse-all": "Parse All", + "no-unit": "No unit", + "missing-unit": "Create missing unit: {unit}", + "missing-food": "Create missing food: {food}", + "no-food": "No Food" + } }, "search": { "advanced-search": "Advanced Search", diff --git a/frontend/pages/g/_groupSlug/r/_slug/ingredient-parser.vue b/frontend/pages/g/_groupSlug/r/_slug/ingredient-parser.vue index cafc7b6ff882..0c2ad94b3fe4 100644 --- a/frontend/pages/g/_groupSlug/r/_slug/ingredient-parser.vue +++ b/frontend/pages/g/_groupSlug/r/_slug/ingredient-parser.vue @@ -2,35 +2,30 @@ - Experimental Feature + {{ $tc("banner-experimental.title") }}
- Mealie can use natural language processing to attempt to parse and create units, and foods for your Recipe - ingredients. This is experimental and may not work as expected. If you choose to not use the parsed results - you can select cancel and your changes will not be saved. + {{ $tc("recipe.parser.experimental-alert-text") }}
- - To use the ingredient parser, click the "Parse All" button and the process will start. When the processed - ingredients are available, you can look through the items and verify that they were parsed correctly. The models - confidence score is displayed on the right of the title item. This is an average of all scores and may not be - wholely accurate. + +
{{ $tc("recipe.parser.explanation") }}
- Alerts will be displayed if a matching foods or unit is found but does not exists in the database. + {{ $tc("recipe.parser.alerts-explainer") }}
-
Select Parser
+
{{ $tc("recipe.parser.select-parser") }}
- Parse All + {{ $tc("recipe.parser.parse-all") }} - Save All +
@@ -145,6 +140,8 @@ export default defineComponent({ const slug = route.value.params.slug; const api = useUserApi(); + const { i18n } = useContext(); + const { recipe, loading } = useRecipe(slug); invoke(async () => { @@ -170,13 +167,15 @@ export default defineComponent({ if (unitError || foodError) { if (unitError) { if (ing?.ingredient?.unit?.name) { - unitErrorMessage = `Create missing unit '${ing?.ingredient?.unit?.name || "No unit"}'`; + const unit = ing.ingredient.unit.name || i18n.tc("recipe.parser.no-unit"); + unitErrorMessage = i18n.t("recipe.parser.missing-unit", { unit }).toString(); } } if (foodError) { if (ing?.ingredient?.food?.name) { - foodErrorMessage = `Create missing food '${ing.ingredient.food.name || "No food"}'?`; + const food = ing.ingredient.food.name || i18n.tc("recipe.parser.no-food"); + foodErrorMessage = i18n.t("recipe.parser.missing-food", { food }).toString(); } } } @@ -364,7 +363,7 @@ export default defineComponent({ }, head() { return { - title: "Parser", + title: this.$tc("recipe.parser.ingredient-parser"), }; }, });